Why Node.js is Better than Java

Why Node.js is Better than Java

Can you say why Node.js is better than Java? Node.js is superior when it comes to concurrency. I’d concur if I knew what that meant. Node.js wins when it comes down to handling
thousands or hundreds of thousands of connections. Node.js handles more concurrent inputs and
outputs than Java. Doesn’t Java handle it? Sure, but not as many. And a website loses
a customer when they get connection errors. In a mobile world, people might hit the refresh
button once or move on to the next site on their list who offers what they want. Node.js is the only server based solution
with non-blocking asynchronous connections. Nobody gets the error that they can’t get
a connection unless there is a denial of service attack. I won’t deny that. But how does Node.js manage
to do it? Because Node.js doesn’t create a single thread
for every connection, it more readily handles people who drop off or close connections while
using fewer resources doing so. End result, fewer resources needed to handle
the same volume of people. Either they get faster connection times and
you get more sales, or you need fewer servers to handle the load. Both of which look really good to big companies.
Why is Java slower? Java gives each thread a stack, and each stack
uses memory. Asynchronous connections prevent the threads from tying the server in knots. This is interesting because I’d heard that
Java was faster. Java can use non-blocking calls and multi-threading.
That programmers don’t use it is a whole other discussion. I’m surprised Node.js does better since it
runs everything on a single core. It was designed to handle lots of calls simultaneously
because it uses only a single core. Node.js is like the trained octopus in customer service
who can handle eight calls at once, while everyone else processes each one at a time
in a hurry. I’ve never seen an octopus in customer service. OK, bad example. But Paypal switched to Node.js,
so that’s a good example of why you should use it, too.

16 thoughts on “Why Node.js is Better than Java”

  1. It is better for somethings but worse for others. It is perfect for real time communication or networking but Java is better for full business apps or number crunching simulations.

  2. Vert.x beats Node.JS, and allows you to program in Java, JavaScript, Ruby, Python, Groovy, and soon Scala, Clojure, Ceylon and PHP. Vert.x can also use multiple cores instead of Node.JS 's just one core.

  3. Why oh why does the Node community continue to put out stuff like this?  The Node community just keeps repeating the lie that they are the only ones with async IO.  Java has many frameworks, both blocking and non-blocking.  Maybe the author of this should check out Netty, Akka, ReactiveX/RxJava, Spring Reactor, etc.  Or the higher level frameworks such as vertx and playframework.

  4. So, Node.js (a framework) is better than Java (the whole language and its ecosystem) because it runs in a single core? This video is so short-minded it's depressing.

  5. how are you comparing node.js to java? its not even comparing apples and oranges its like comparing humans to flour

  6. Node.js uses a thread pool for I/O. These separate threads are all free to run on multiple cores, although the operating system manages this, not you.

  7. Isn't Node.js an application written in C to listen incoming http requests and send back responses to the clients? and isn't Java a programing language? If so than how are you comparing a web server to a language? Are we creating a new religion here???

  8. I am not a Node.js fan but I have done my homework and have read a good article "What is Node.js?" by Brett McLaughlin. Please google it to educate yourself.

  9. How about some benchmarks to back up your assertions rather than crap puns & Steven Hawking voice overs? No wonder your vote counts are disabled. Oh & BTW use cluster & you can use multiple cores with Node

Leave a Reply

Your email address will not be published. Required fields are marked *