Skip to content
Contact

Series · 7 parts

Node.js Runtime Internals

How Node.js actually works under the hood and how to build on it: the event loop and non-blocking I/O, async patterns, streams and backpressure, worker threads for CPU-bound work, clustering across cores, finding memory leaks, and error handling that stays honest about bugs.

  1. The Node.js Event Loop Explained: How Single-Threaded Serves Thousands

    Almost every confusing thing about Node.js traces back to one mechanism: the event loop. Understand it and the rest of Node becomes a coherent system.

    Part 1 of 7 · Node.jsThe Node.js Event Loop Explained: How Single-Threaded Serves Thousands — Aman Kumar Singh
  2. Node.js Async Patterns: Callbacks, Promises, and async/await

    Async code is the native language of Node. How you express "do this, then that" has evolved through three generations — and each carries its own traps.

    Part 2 of 7 · Node.jsNode.js Async Patterns: Callbacks, Promises, and async/await — Aman Kumar Singh
  3. Node.js Streams and Backpressure: Processing Data Without Running Out of Memory

    The difference between a Node service that handles a 2 GB file on a small server and one that crashes is almost always streams. Backpressure is what makes them safe.

    Part 3 of 7 · Node.jsNode.js Streams and Backpressure: Processing Data Without Running Out of Memory — Aman Kumar Singh
  4. Node.js Worker Threads: Moving CPU Work Off the Main Thread

    Node is superb at I/O and helpless at CPU-bound work on the main thread. Worker threads run JavaScript on separate threads so heavy computation stops freezing the loop.

    Part 4 of 7 · Node.jsNode.js Worker Threads: Moving CPU Work Off the Main Thread — Aman Kumar Singh
  5. Scaling Node.js with the Cluster Module: Using All Your Cores

    A single Node process uses a single core. Your server has eight. The cluster module runs multiple processes on the same port so all your cores serve requests.

    Part 5 of 7 · Node.jsScaling Node.js with the Cluster Module: Using All Your Cores — Aman Kumar Singh
  6. Node.js Memory Leaks and Profiling: Finding What Holds Memory

    A Node memory leak rarely announces itself — memory creeps up over hours until the process is killed. In a garbage-collected runtime, a leak is a reference you failed to drop.

    Part 6 of 7 · Node.jsNode.js Memory Leaks and Profiling: Finding What Holds Memory — Aman Kumar Singh
  7. Node.js Error Handling: Operational vs Programmer Errors

    Error handling is where a lot of Node apps quietly fall apart — a hung request, a silent crash. Getting it right is about where errors surface and which you can recover from.

    Part 7 of 7 · Node.jsNode.js Error Handling: Operational vs Programmer Errors — Aman Kumar Singh