Announcing Zones for Node.js

The first build of what will become Node v0.12 was released about a year ago back in April of 2013. StrongLoop has been busy making significant contributions of code to v0.12, and we’ve added a bunch of cool new features including performance optimizations, cluster round-robin and the ability to run child processes synchronously.

We’re waiting eagerly for Node v0.12 to be released. Unfortunately, the release may not happen soon since there are about 800 open bugs and about 180 pull requests waiting to be reviewed. While this work is on going, we’ve starting thinking past v0.12 and begun work on other areas which could use improvement.

Flow Control, Error Handling, Long Stack Traces

Managing async flow and avoiding callback hell can be accomplished if you develop in a disciplined manner. However, handling errors in async flow in a clean and easy to follow manner can prove very challenging even for experienced Node developers.

I’ve been on the Node core team for quite some time (since 2011), so I’ve had the benefit of seeing a lot of attempts at solving this problem. For a long time Node.js had an ‘event-source’ branch that contained an attempt but it never worked well enough. and similarly I tried to solve the problem myself in early 2012 but I could not fit the pieces of the puzzle together at the time.

In Node v0.8 we got domains for which I had high hopes. Unfortunately, it’s behavior was and still is too surprising for most people to use it, and with domain.dispose() deprecated (it never worked) I feel it lacks ambition.

In the past couple of months I’ve prototyped another library. I’d like to have as much feedback as I can get; Sam Roberts, Ben Noordhuis, TJ Hollowaychuck have had their shot. It’s your turn now: today I’m excited to make available Zone for general testing (and hopefully contributions!) so that together we can continue to evolve Node.

Note that I’m not the only one trying to make Javascript and Node better in this area – there are also promises, trycatch and Brian Ford’s Zone.js. If you aren’t familiar with these projects yet, we’ve written up a comparison.

Introducing Zones

The ‘zone’ npm module provides the following:

  • Automatic resource cleanup and layered exception handling
  • Long stack traces
  • Detection of and handling of common pitfalls with callbacks
  • The association of arbitrary data with asynchronous control flow Read more

StrongLoop Node.js Weekly Review – May 27, 2014

Here’s this week’s recap of the Node.js related blogs we posted last week…

Open Source Replication and Offline Sync for Node.js and Devices

StrongLoop is excited to announce support for replication and offline synchronization in our LoopBack API framework. What makes this unique is that it is completely open source and powered by Node.js. Loopback is an open source API framework written in Node.js used to connect mobile devices to enterprise datasources. This new functionality is available for OracleSQL ServerMongoDBPostgreSQLMySQL and any LoopBack connector which supports create, read, update and delete (CRUD) operations.

Read more…

What’s New in the LoopBack Android SDK 1.3 – User Auth and Storage Service

StrongLoop is excited to announce a new version of the LoopBack Android SDK 1.3. The release adds two new features: user authentication and storage service client. The LoopBack Android SDK provides classes that make it easy to connect an Android client app to a server application using LoopBack’s authentication and authorization model: User, that represents on the client a user instance on the server, and UserRepository.

This new SDK version also adds support for working with files using the LoopBack storage service.  The storage service makes it easy to upload and download files to cloud storage providers and the server local file system. It supports Amazon, Rackspace, Openstack and Azure.

Read more…

Node.js How-to: Publishing to Multiple npm Registries

As we mentioned in the previous post, “Easy Switching Between Public and Private npm Registries”, the topic of running a private registry server is quite broad. Once you’re running  your private registry server and know how to switch between different registries when installing packages, it’s time to look at the process of package publishing.

Read more…

Use StrongOps to Monitor Node Apps

Ready to start monitoring event loops, manage Node clusters and chase down memory leaks? We’ve made it easy to get started with StrongOps either locally or on your favorite cloud, with a simple npm install.

Screen Shot 2014-02-03 at 3.25.40 AM

What’s next?

Node.js Performance Tip of the Week: Event Loop Monitoring

Please note that as of Aug 3, 2015, StrongOps has been EOL’d. Check out StrongLoop Arc for the same capabilities and more.

In last week’s performance tip, we discussed in detail how to scale Node.js applications using proxies and clustering. In this week’s post we’ll look at the basics of how an event loop works and how it can cause performance issues when it goes into blocking mode. We will also discuss some tools to triage blocked event loops.

The almighty event loop

The event loop gives Node the capability to handle highly concurrent requests while still running “single-threaded”.  The event loop delegates processing to the operating system via POSIX interface while still handling new request events and callbacks.

threading_node

You can read more about workings of the event loop in one of our previous blogs. In layman terms, an event loop is like a mailman delivering messages (events) to every mailbox marked by specific routes (callbacks). This mailman is a single person running on only one code path at one time. While on a code route, he can get an additional event transmitted by the same callback function handling a previous request event. When this happens the postman can take a small diversion, delivering the new event (message) to its destination mailbox and then carrying on with the original route (callback) to deliver the event. Read more

Open Source Replication and Offline Sync for Node.js and Devices

Today, StrongLoop is excited to announce support for replication and offline synchronization in our LoopBack API framework. What makes this unique is that it is completely open source and powered by Node.js. Loopback is an open source API framework written in Node.js used to connect mobile devices to enterprise datasources. This new functionality is available for Oracle, SQL Server, MongoDB, PostgreSQL, MySQL and any LoopBack connector which supports create, read, update and delete (CRUD) operations.

Enterprise mobile apps require offline sync capabilities

The ability to work offline has emerged as a requirement for almost all enterprise mobile applications that are data-driven. Up until now, developers first had to figure out how to locally store a subset of the application’s data. Second, they had to implement a mechanism that could keep the data synchronized on both the client and server. The previous generation of synchronization and replication technologies that tried to address these challenges were low level and inflexible, with little choice or variety in the data sources they supported. Fine grained controls on the behavior for common use cases like change detection and conflict resolution were also lacking.

Replication and offline support in Loopback

What this means for developers creating isomorphic JavaScript apps is, that for the first time they’ll be able to easily synchronize to and from various databases without requiring constant network connectivity. LoopBack’s replication also handles the complexity of moving data between mobile devices, mobile device to server and server to server. This means developers can focus on the the front end versus the mechanics of how to replicate data between disparate databases whether they be in cloud or in the datacenter.

sync2

Read more

StrongLoop Upgrades LoopBack API Framework with Replication and Offline Synchronization Support

SAN MATEO, CA – May 22, 2014 — StrongLoop, the leading provider of solutions for Node.js, today announced support for replication and offline synchronization in its LoopBack API framework. Loopback is an open source API framework written in Node.js used to connect devices to enterprise datasources. This new functionality is available for Oracle, SQL Server, MongoDB, PostgreSQL, MySQL and any LoopBack connector which supports create, read, update, delete (CRUD) operations. Read more