18 Node.js and JavaScript libraries for fast and simple microservices

Whether you go serverless or server-full, look to these open source projects to support your Node.js microservices

Long ago in the early days of the Internet, pointing your browser at a URL meant your machine would start up a conversation with one server, and only one—the one connected with that URL. That may still happen if you visit a personal blog, but today all of the major websites and most of the small ones are really constellations of servers, sometimes dozens, sometimes hundreds, and sometimes even thousands.

Node.js has always been a popular foundation for enabling this leap into the future. Perhaps it’s because Node.js exploded in popularity around the same time as the microservice paradigm. Perhaps it’s because Node.js fits well in Docker containers. Perhaps it’s just because JavaScript is everywhere. Now when we go to a website, our packets travel to Node.js stacks, triggering more calls to more Node.js servers, each delivering a portion of the data that fills our screens.

One big reason for Node’s rise may be the simplicity. A functional Node.js microservice can be built with just a few lines of code: one to listen on a port, a handful to connect to any database, and then a few more to encode the business logic. The difference between a “Hello World” example and a running microservice is only a function or two. Node.js was designed and built by people who wanted to serve up bits on the Internet.

It’s not just the simplicity of the code. The Node.js community will cite many more practical reasons why Node.js is everywhere. Some will focus on the incredible, lightweight Node.js runtime. It starts up in seconds and doesn’t chew up RAM to create threads to process each incoming and outgoing request. The IO routines are optimized for getting data in and out quickly without spending too much time on creating objects to track threads and other ephemera. The call-back paradigm can be a bit of a challenge to novice programmers, but the result is blazing speed and very little load on the machine. This makes it easy to spin up multiple, fast microservices in the cloud.

Others love the idea that the Node.js world has been dominated by open source from bottom to top. The original version of Node was an open source project that was built upon a JavaScript interpreter that was itself open source. All of the major Node.js frameworks are open source and the ethic is so dominant that it can be hard to find a proprietary block of code anywhere in many Node.js stacks.

To continue reading this article register now