We are in the golden age of software. We have tools for everything. We have the tools to make tools. We build core systems into high-level products. But one thing is common at all levels: the infamous memory leak. It is not always a bug in code; sometimes not understanding the behavior of runtime can cause it as well.
The runtime in question here is Node.js. There are a few types of memory leaks that are very common. I have written about two of them in Part 1. In Part 2, we are going to explore the other two types.
Project Link: https://github.com/Joker666/NodeJS-MultiCore-Demo
Javascript is a single threaded language, therefore one call stack and one memory heap. NodeJS uses Javascript to develop server side applications and shares the same behavior. It runs on one CPU core regardless of how many CPU cores you have in your machine or a virtual machine in the cloud. The single threaded nature of Javascript is actually good in a browser based system but falls short in a backend system as backend needs to be powered with all the gears the machine can provide to not waste resources.
Project Link: https://github.com/Joker666/microservice-demo/
The Complete Microservice Tutorial — Part 0
Microservices are about decoupling your system. In a monolith, you build all the components of the software in one large codebase and deploy the software at once. But in the microservice world, we build each component of a large system decoupled from each other.
In Part - 0, we explored the project’s architecture and now we are going to build it. We are going to build the authentication and user service module of the application. We will use NodeJS for this logic and MongoDB for the data layer.
Since we…
Part 2 — The 4 Types of Memory Leaks in Node.js and How to Avoid Them
It is very common for software to introduce bugs. How we manage them is the real issue. One of the most common bugs in the production environment is memory leaks, and Node.js is notorious for being prone to this. So if you are a software developer who is building Node applications in production, understanding how memory leaks can happen and how to tackle them is an uncanny skill.
A Node application is a long-running process that is bootstrapped once until the process is killed…
Project Link: https://github.com/Joker666/microservice-demo/
Part 1 - Building User Service with GRPC, Node.JS, and MongoDB
If you have not been living under the rock for a while, microservice is the defacto architecture to make large scale applications these days. A lot of companies have moved from monolithic architecture to microservice-based architecture like Uber, Netflix, Etsy, and so on. Companies adopt this structure as it simplifies their development and reduces complexity.
This is a 6 part tutorial where we will build a complete microservices-based application from scratch. You can see what has been built already in the project link.
I have been…