This is regarding slides by Rob Pike with above title. Every time I go thru this I feel like a moron. I'm not able to to figure out the gist of it. It's well understood that concurrency is decomposition of a complex problem into smaller components. If you cannot correctly divide something into smaller parts, it's hard to solve it using concurrency. But there isn't much detail in slides on how to get parallelism once you've achieved concurrency. In the Lesson slide (num 52), he says Concurrency - "Maybe Even Parallel". But the question is - When and How can concurrency correctly and efficiently lead to Parallelism? My guess is that, under the hood Rob's pointing out that developers should work at the level of concurrency - and parallelism should be language's/vm's concern (gomaxprocs?). Just care about intelligent decomposition into smaller units, concerned only about correct concurrency - parallelism will be take care by the "system". Please shed some light. Slides: http://concur.rspace.googlecode.com/hg/talk/concur.html#title-slide
HN Discussion: http://news.ycombinator.com/item?id=3837147 |
NodeJs' non-blocking IO makes it a great choice for near real-time communication, like streaming editors, messaging, reacting to high freq events (like metrics). See: http://socket.io, http://en.m.wikipedia.org/wiki/Surespot and https://github.com/etsy/statsd
It is also great when you want to prototype a REST backend, and get it up and running in no time. The simplicity of javascript along with nodejs' module ecosystem make it a breeze (Ruby equivalent would be Sinatra).
What nodejs isn't good at is, parallelism. Concurrency is handled for you for free by the underlying libuv eventing framework. Pseudo-parallelism is achieved using 'clusters' but communication between node processes is costlier than in other languages that support parallelism out of the box.
Read https://news.ycombinator.com/item?id=4305486 for aphyr's excellent commentary on clojure vs nodejs (you can also find Ryan Dahl defending nodejs in a few cases there)