NodeBookAdvanced Node.js guide

MASTER THE
NODE.JS
INTERNALS

A practical engineering guide to V8, libuv, streams, modules, memory, and production debugging.

Author: Ishtmeet Singh
NodeBook overview

NodeBook curriculum

Advanced Node.js internals

_

Subscribe for updates

New chapters, slides, and release notes. No spam.

70,000+ readers2,800+ subscribersUnsubscribe anytime
38 CHAPTERS///240+ SUB-CHAPTERS///PRODUCTION SYSTEMS///38 CHAPTERS///240+ SUB-CHAPTERS///PRODUCTION SYSTEMS///38 CHAPTERS///240+ SUB-CHAPTERS///PRODUCTION SYSTEMS
Why NodeBook

Understand Node.js
at runtime.

NodeBook explains what happens inside the runtime when your application handles I/O, schedules work, allocates memory, and serves traffic.

01

Libuv & Event Loop Internals

Understand poll/check/idle phases, threadpool queueing, and platform differences across epoll, kqueue, and IOCP.

02

V8 Compilation Pipeline

Debug deoptimizations, hidden class transitions, and polymorphic inline cache misses with practical examples.

03

Zero-Copy Stream Architecture

Implement binary protocols with backpressure-aware transforms, scatter/gather I/O, and external memory management.

04

Native Addon Development

Build thread-safe N-API modules, move work through uv_queue_work, and handle memory across JavaScript and C++ boundaries.

05

Production Observability

Propagate trace context with AsyncLocalStorage, control metrics cardinality, and analyze latency with flamegraphs.

06

Production Memory Management

Tune generational GC flags, track retainers in heap snapshots, handle external memory pressure and OOM mitigation.

Understand
the mechanism.

Most Node.js tutorials stop at syntax. NodeBook focuses on runtime behavior. This example shows how backpressure changes memory use under load.

The problem: unbounded buffering

Buffering an entire file before sending it can exhaust the V8 heap under concurrent traffic.

The fix: stream backpressure

Read in chunks, respect `highWaterMark`, and pause the readable stream when the writable side applies pressure.

const fs = require('fs');
const http = require('http');

http.createServer((req, res) => {
  // Problem:
  // fs.readFile buffers the entire file content into V8 heap.
  // If 'big_data.csv' is 2GB and you have 50 concurrent requests,
  // your process crashes immediately with heap out of memory.

  fs.readFile('./big_data.csv', (err, data) => {
    if (err) throw err;
    res.end(data);
  });

}).listen(3000);

// Status: Process terminated.
// Reason: JavaScript heap out of memory
Heap pressureLn 14, Col 22
Curriculum overview

Table of
Contents

33 chapters planned
Estimated reading time: ~180 hours
Ch 01: Node.js Architecture
Ch 02: Buffers & Binary Data
Ch 03: Streams
Ch 04: File System
Ch 05: Process & Operating System
Ch 06: The Module System
Ch 07: Async Patterns & Control Flow
Ch 08: The Event Loop
Ch 09: Timers & Scheduling

Included Material

  • [x]161 Sub-chapters
  • [x]50+ Hands-on Labs
  • [x]Production Checklists
  • [x]Architecture Diagrams

For experienced developers

This curriculum assumes you already write JavaScript regularly. It focuses on runtime behavior, operational tradeoffs, and the details that matter when Node.js runs in production.

Audience fit

Who this
is for

NodeBook is written for developers who already build with Node.js and want a deeper operating model.
Current focus

Application developer

Common gaps
  • [-]Uses frameworks well, but has limited runtime visibility
  • [-]Finds memory leaks late, often after production symptoms
  • [-]Handles large payloads without always measuring allocation cost
  • [-]Needs clearer tools for profiling, backpressure, and shutdown behavior
Intended outcome

Runtime-focused engineer

Production practice
  • [+]Profiles V8 heap snapshots and allocation paths
  • [+]Implements backpressure with streams
  • [+]Moves CPU-bound work to Worker Threads when needed
  • [+]Operates Node.js services with clear deployment and scaling tradeoffs
New chapters and release notes, sent when they are published.
Currently publishing

Publication
roadmap

Updated as chapters are published
Online chapters remain free
Offline editions will be announced separately
Available
VOL I: Core
  • Architecture Done
  • Buffers Done
  • Streams Done
  • File System Done
  • Process & OS Done
  • Modules Done
  • Async Patterns In progress
  • Event Loop Pending
  • Timers Pending
First chapters published
In progress
VOL II: Advanced runtime
  • Worker Threads Drafting
  • Clustering Pending
  • N-API Pending
Planned
HARDCOVER

Physical editions are planned after the online chapters are stable.

Schedule to be announced
Planned
VOL III: Operations

Deployment, containers, scaling, and distributed-systems observability patterns.

Schedule to be announced
Current progress
Volume I chapters are being published online.
Examples and diagrams are included with relevant chapters.
Async patterns are the current writing focus.
Event loop and timers are next in the runtime track.
Slides and downloadable material will be released alongside selected chapters.
Dates may move as chapters are revised and fact-checked.
Subscribe to get release emails when new material is published.
Free online access

Knowledge should be free.

NodeBook is free to read online. Offline editions and downloadable bundles will help fund ongoing writing and maintenance.

Live Reader

$0

The entire book, available online forever. No paywalls, no ads, no trackers.

  • Full access to every published chapter
  • Interactive code examples
  • Dark and light reading modes
  • Global search
  • Reader discussion
SAVE 50% - LIMITED TIME

Volume I

$24.99$49.99

Own the offline files for Volume I: Foundations. Read anywhere, no internet needed.

  • Ebook: $24.99 (PDF, EPUB, MOBI)
  • Paperback: $34.99
  • High-resolution architecture diagrams
  • Hands-on code labs
  • Downloadable reference material
COMING SOON
Note: offline editions will be announced when the corresponding online volume is ready.

Resources
and downloads

Cheatsheets, source code, diagrams, and workshop material will be published alongside the relevant chapters.

Coming soon
Source code
--
Workshop recordings
--
Cheatsheets
--
Deployment examples
--

Reader feedback

Early notes
Confirmed testimonials will be added as the project grows.
To: Ishtmeet
Recent
From: Early reader
Subject: Thanks for making this free

Just wanted to say thank you for keeping this resource free and accessible. Not everyone can afford expensive courses, and this really helps people like me who are trying to learn on a budget.

To: Ishtmeet
Yesterday
From: Backend developer
Subject: Re: Node internals

I've been looking for something that actually explains how Node works under the hood, not just how to use it. This is exactly what I needed. Appreciate you putting this together and sharing it with everyone.

To: Ishtmeet
Recent
From: JavaScript developer
Subject: Quick thanks

Finally a resource that doesn't assume I already know everything. The explanations are clear and the examples actually make sense. Thanks for taking the time to write this up.

Ishtmeet SinghAuthor
Consulting
Ishtmeet

Ishtmeet Singh

Node.js Developer Since 2014
10+ Years Node Experience
70,000+ Readers
Open Source Contributor

About the author

I've worked with Node.js since 2014, building real-time applications, backend services, and performance-sensitive systems that need clear operational behavior.

Many developers use Node.js every day, then get stuck when performance bottlenecks, memory growth, or scaling issues show up in production. My work in Rust and C++ changed how I read Node.js internals, and that systems perspective shapes this guide.

NodeBook comes from years of reading runtime behavior, debugging production issues, and documenting the details that usually stay scattered across source code, docs, talks, and incident notes.

[i]

I've always believed that knowledge should be accessible, which is why NodeBook is completely free to read online.

NEW RELEASE EMAILS

SUBSCRIBE FOR
UPDATES

Get an email when new NodeBook chapters, slides, and updates are released.

[x]No spam ever
[x]Unsubscribe anytime