Home / Jargon Free Introductions
Scaling Node.js Applications - Index

What is the problem with respect to scaling Node.js applications

Node.js is single-threaded

Node.js can offload many of its tasks to the OS kernel

But Node.js requests can get queued up when Node.js main thread is blocked

Because Node.js is single threaded, adding additional CPU cores cannot solve the scalability issues.

How do we scale our Node.js applications with worker threads?

We can leverage worker threads to execute CPU intensive tasks to free up the Node main thread

With worker threads, we can achieve vertical scalability

How do we scale our Node.js applications with multiple Node instances?

We can run more than one instances of the Node.js server

Instances of Node.js server can also be run across machines.

Running instances of Node.js across virtual machines enables horizontal scalability

Considerations when scaling Node.js setups with multiple Node instances

A node process should not store session-specific stuff in it's own memory

A node process should store session-specific stuff in a common store

What are some ways to manage scalable Node.js setups?

Nginx with systemd


Docker with devops automation on the cloud

Dockerized node deployments on the cloud enable horizontal scalability

Want to be notified via email when a new explainer is added?
Want to be notified when I add a new explainer?
Copyright (c) 2017-2023 Tezify All Rights Reserved. Created in India. GSTIN : 24BBQPS3732P1ZW.