r/javascript • u/endpointben • Aug 11 '15
Netflix.com Adopts Universal JavaScript, Drops Java From Rendering Pipeline
http://www.infoq.com/news/2015/08/netflix-universal-javascript
482
Upvotes
r/javascript • u/endpointben • Aug 11 '15
3
u/novagenesis Aug 12 '15
I used to drink that same Kool Aid. "Node's great for I/O, but choose something else for everything else".
Two thoughts on that. First, people are as likely to choose Python as Java for heavy math... While node's math libraries aren't mature, it tends to crush python by orders of magnitudes with apple-to-apple calculations.
But yeah, Java's still faster than node for heavy stuff... But I think there's more caveats than people realize here.
You're not going to make your heavy duty operation as a POJO and start hitting it a million times per minute. Just because node.js gives you great I/O scale for free, doesn't mean there's a bad ROI on careful scale for math.
As I said before, for loops and recursion, you can async them to disable blocking (works for heavy operations as much as it does for database operations).
If it's one massive calculation, instead of millions of big calculations, you have to add a service infrastructure... but you have to setup a JBoss server or the equivalent to handle that scale in Java in a real world scenario.
Maybe Java has higher ROI for big-math scale, but I've discovered the profitable way that it's not nearly as bad for node as the stereotype claims. You're talking a 2-3x, not 2-3 orders of magnitude.
I'm not saying Java is not worth it. There's times when 2-3x is worth the greater programmer-share and greater maintenance. There's also the paradigm shift to node. Some problems don't breakdown well in terms of defers and events. They need to be mapped. Alternatively, some problems don't breakdown well in terms of objects. We're just more trained to normalize to OO more than other paradigms.
I've yet to find a problem that can't be solved in node and can't scale in node. I have often found problems that require rethinking in node.