DEV Community

Devjeet Roy
Devjeet Roy

Posted on

Node.js v/s Spring for startups

Firstly, if you are like me, coming from a C, C++ background and then switched over to JavaScript for Front-end web development with very little or almost no knowledge in Java, Node.js should be your choice. But if you are well versed with Java, you may pick as you are comfortable with.

Secondly, Node.js is single threaded. If something goes wrong and Node.js crashes, then everything crashes. You donโ€™t have the isolation that you have with a Java web application.

Thirdly, Spring Boot is fabulous: light and fast, complete and extremely configurable. Spring Boot strictly follows the MVC pattern. But in case of Express.js (minimalist framework for Node.js) it may or may not be configured like that way. So, if you mess up the codes its a problem.

Fourthly, authentication in Spring is better as compared to Passport.js used with Node.js. But Passport.js supports major functions of Spring authentication and are sometimes simpler to code and understand the logic. Hibernate is still the most complete, mature, and versatile solution, but at a very high cost! Sequelize may cover 90% of your use cases. Sequelize is easy to create queries at runtime. Try to do it while creating a JPQL query or consider how over-complicated it is to do with certain criteria. Sequelize is a better option as per me.

Lastly, as we are talking about startups, I will consider simplicity and flexibility over strict MVC and robustness of Spring. JS makes things much simpler and easy to code. Besides, the workflow in Node.js is much faster then that in Spring. Even, the learning curve is also smooth in Node.js as compared to Java. Rather then this build management is much tougher with Maven than with NPM.

BONUS : According to Stack overflow survey, Express is before Spring both in terms of most loved and most wanted web frameworks. Even with Node.js you can code JavaScript at both ends of the website. But, Spring has been in market for long and has a large ecosystem supporting it. The number of high quality third-party libraries available in Java is very high.

So at the end of the day, it is a matter of choice.

Even feel free to visit my blog : LEARNNODEONLINE.BLOGSPOT.COM | A PLATFORM TO LEARN NODE.JS

Top comments (0)