Back to the Catalog
system-design
nodejs

Scaling a Node.js Service

13 questions

A single Node process runs your JavaScript on one event-loop thread — so scaling it is a system-design problem, not a config flag. Build intuition for statelessness as the precondition for horizontal scaling, cluster vs. worker_threads, moving shared state into Redis, why sticky sessions are a smell, graceful shutdown and connection draining on SIGTERM, liveness vs. readiness probes, and keeping CPU-bound work off the event loop. Code snippets and the libuv thread-pool facts are verified against current Node.