Microservices and Node.js

10 / Aug / 2017 by Prince Soni 1 comments

Traditional software product development starts with one problem in mind and project continues to grow with an inclusion of new feature this leads to a single monolithic system. Every new functionality added increases complexity and difficulty in scaling system. Increasing functionality results in an increase in thousand lines of code turned out to be a nightmare for deployment team. Adding the small change in the system impacts entire project stack and leads to a complex development environment.

For solving this problem, many enterprises turn their head towards new architecture known as Microservice.

What is Microservice?

Microservices are a single self-functional system which along with other unit forms large big system. Each small unit of the system is fully functional, scalable and deployable system. Each unit can be written in different programming language and tested separately without causing an impact on other parts of the system.

Microservices are the big block made up from smaller sub blocks (Services) with each sub block being an independent operating unit. If any of the unit (services) goes wrong, it will not take long to replace that service, which in turn reduces the risk of development and the costs involved in the operation of the infrastructure.

microservices_Redesign-01 (1)
Benefits of Microservices architecture:

  • The application takes lesser time to start, which increases developers productivity and speeds up deployments.
  • The system can be scaled easily and boost system performance.
  • Each service can be deployed without affecting other services, which allows deployment of new versions of services frequently.
  • Microservices are independent of each other and have a specific role. Changes made to one microservice does not affect other.
  • No restriction of technology in developing any service, there by making system technologically independent.

Drawbacks of Microservices:

  • Deployment complexity increases as the need to manage a system comprised of many different service types.
  • The developer needs to handle complexity for creating separate distributed system.

Microservices versus monolithic architecture when application grows

Monolithic

  • Understanding huge code base becomes difficult, especially for new developers.
  • Large code files make development environment slow like IDE.
  • Changing technology or language becomes complicated as the code base is tightly coupled.
  • CI/CD becomes challenging and time-consuming and needs a dedicated team to manage it.

Microservices

  • Microservices are small and specific to business requirements.
  • Microservices are loosely coupled and can be easily developed and deployed.
  • Development can be done using different technologies.
  • Microservices can be built with new technology stack enabling faster development cycle.
  • Microservices can be easily scaled on demand.

Why Microservices with Node.JS

  • Productivity – Node.js uses NPM (node package manager) which comes up with tons of ready to use modules which speed up the development process. Node.js uses javascript as interface language so that same language can be used for back end and front end. This saves lots of development time.
  • Performance – Node.js event driven I/O model along with microservices strategy which can handle an extreme amount of load with lesser response time.
  • Developer FriendlyNode.js has vast community support and is backed by millions of developers across the globe. Node package manager (NPM) contains more than 4 million ready to use modules which serve as heaven for developers. Node.js enables faster development of applications which are easily scaleable, there by making the developer happy through out application development life cycle.

Node.js supports multiple Microservices framework which enables development of application based on microservices strategy. Most popular among them are Senaca js.  Senaca js provides a complete environment for the development of the microservice based application.

Enterprise embracing Microservices with Node.js

  • Go Daddy 
    • Go daddy was able to host their customer website using 10x fever resources by switching to Node.js and microservices architecture. Time To First Byte (TTFB) considerably from ~60ms to something around ~12ms.
  • Paypal
    • Node.js and microservices architecture help PayPal to modularize their stack and cross functional team was able to roll out the new feature at much faster rate.
  • Netflix
    • Built high-performance microservice based system for serving video service. App startup time was reduced by 70% and Netflix started using universal application with javascript serving both front end and back end.

Microservices are certainly the game changer with not only enhancing the overall experience of development teams but also improves the user experience of end users.

Learn more about building microservice architecture and its best practices.

FOUND THIS USEFUL? SHARE IT

comments (1 “Microservices and Node.js”)

Leave a comment -