What are the pros and cons of using Node.js instead of Java for a new backend system?
-
Java has Netty and Play; is faster because it is static; and has more mature development tools. JavaScript itself is neither more elegant nor more succinct than Java. I am evaluating Node.js for the task of building a new backend system from scratch and want to understand what its benefits are versus Java.
-
Answer:
Model code and tests can be shared between the client and server if we assume a web browser as the client. JavaScript is actually more succinct in a few small ways but these come with the "feature" of not requiring strict variable types. Node has a younger and more vibrant and active community. While I am unsure that Node will ever rival Java in popularity, its use is rising quickly while Java's is diminishing slowly. If you are developing in a team that does not divide into separate front end and back end teams, but rather does end to end development then there is a great advantage of not having to switch modes of thinking as you switch from backend to front end. This reduces stress from the cognitive dissonance associated with switching paradigms frequently.
Kevin Ernest Long at Quora Visit the source
Other answers
The answer to this question depends on many factors. The main ones I can think of are: How complex are the computations made by your backend system ? How many concurrent connections are expected ? The more I/O requests you do and the less cpu computation cycles you use, the more likely NodeJS to work for you. An extreme example for this case would be a chat application where you have, let's say 1000's requests/sec and they all fit in one thread (note: NodeJS has a single thread), so you avoid creating multiple threads + you avoid the time to context switch. In addition, because in Node, you want to keep your logic simple and not cpu hungry, the requests won't pile up and thus your response time become fast. Finally, here's a nice read that compares perforance of the two http://blog.shinetech.com/2013/10/22/performance-comparison-between-node-js-and-java-ee/.
Mouhcine Aitounejjar
It really depends on what you're trying to do with your webapp. If you're doing a lot of io bound tasks then nodejs is just fine. However if you find yourself doing a lot of of cpu bound tasks than you're better off using java or whatever jvm language you prefer because doing cpu bound tasks in nidejs will block the event loop and basically kill your throughput. Node and java/tomcat/spring are my tools of choice and I often use them together on the same project.
Jerry Hicks
Related Q & A:
- What are the pros and cons of having a pet rabbit?Best solution by Yahoo! Answers
- What are the pros and cons of a pharmacist?Best solution by Yahoo! Answers
- What are the pros and cons of buying a house using an FHA loan?Best solution by Personal Finance and Money
- What are the pros and cons of a career in marketing?Best solution by Quora
- What are the pros and cons of being a Corporate or International Lawyer?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.