Wednesday, June 04, 2014
Node Road show recap. When to use and not use node.
I was recently at a Node road show. This was very much like the OTN tour just obvious focused on Node. They had multiple big customers there to share how they used node, what worked, and what doesn't. There were 3 things that stood out for for me about when when to use Node.
First, that node is designed for high concurrency low latency. In case you didn't know node has 1 execution thread. Here's a blog that explains it very well, http://www.aaronstannard.com/post/2011/12/14/Intro-to-NodeJS-for-NET-Developers.aspx. That means a simple loop like while(true){} will lock up the entire node server. Now, you may think oracle's OCI is not async so it's all lost. Node takes care of when it's waiting on I/O. While waiting on I/O from the database, node.js will push this work to the queue until there's a response then it comes back to the main thread for more execution.
Second, Node as the Front End's Backend. Yahoo and Rakuten was there and explained how they use node to be the buffer from the front end to the "real" backend. This makes a place where the front end developers can use what they know , javascript, and perform server side operations. They can use the same REST based access the browser would use to also access the backend.
Third, A lot of people probably know this but is not meant for thing like finance. Here's a simple example that math isn't a main point when it matters. There are plans for Javascript to add a bigdecimal eventually which would remedy this.