Runrioter Wung wrote:Node is very, very hot, and I just coded in javascript for the front-end before.I wonder when I should choose JS for backend not .NET or JavaEE(I am a J2ee programmer). Which type of application is the one that Node is designed for?Asyncronous and evented nature of Node is very cool,but sometimes sequential programming is a must.How can I implement it by JS.I don't know that if all I ask is in the book named NODE.JS IN ACTION.
Hi Runrioter,
Node.js is great for applications that require high concurrency and minimal CPU/memory usage. So things that should feel "real-time" like online games, chat, and web applications. For a balanced look at what use-cases Node.js is most suitable for, I recommend Chris Richardson's talk "Node.JS: The Good Parts? A Skeptic's View" (
https://www.youtube.com/watch?v=CN0jTnSROsk).
If you need part of your application to be sequential, you can a technique called "flow control". Flow control makes asynchronous logic behave in a synchronous fashion. You can either implement flow control yourself in your application or, much easier, simply use flow control modules. One such flow control module is async (
https://github.com/caolan/async).
Cheers,
Mike