⚙️

Documentation Course

Node.js In-Depth

From Runtime Basics to High-Throughput Distributed Systems

Start Reading

A complete A-Z Node.js curriculum — from absolute basics for beginners through production application patterns for mid-level engineers to the deep engine internals and distributed architecture that only senior engineers ever learn. Built from years of running Node.js in production, on a blockchain indexer handling 500–1,000 TPS and on UPI payment networks.

Written by Jatin Jain Saraf · Architect of SupraScan
Free46 modulesBeginner to AdvancedWritten / Documentation-style46 of 46 modules live

How to use this course

This course works as both a sequential read and a standalone reference. Read front-to-back to go from zero to principal-level Node.js engineer. Or jump to any module when you need it — async gotchas in Foundation, JWT auth in Practitioner, or event loop saturation and GC pauses in Architect.

Total reading time

~14.5 hrs

across 46 live modules

Built from

500–1,000 TPS

blockchain indexer + UPI gateway

Prerequisite

Zero Node.js to Principal Engineer

Complete beginner through systems architect

Phase 1 — Foundation

Absolute basics · No prior knowledge assumed

9 modules
F-1
What Is Node.js and Why Does It Exist?
The problem that created Node.js, how V8 works, Node vs browser JavaScript, installing Node, and running your very first program.
F-2
The Module System: CommonJS and ESM
require() vs import/export, how Node resolves modules, built-in core modules, and the circular dependency trap every beginner falls into.
F-3
Working with Files, Paths, and the Environment
The fs module, sync vs async variants, path.join and path.resolve, process.env and process.argv — reading from and writing to the real world.
F-4
Async JavaScript: Callbacks, Promises, and the Event Loop Intro
The callback pattern, callback hell, Promises, async/await, Promise.all — and a first look at why Node.js never blocks, without the deep internals.
F-5
npm and the Node.js Ecosystem
package.json anatomy, semantic versioning, package-lock.json, npm scripts, and the essential dev tools every Node.js engineer installs first.
F-6
Building HTTP Servers and REST APIs with Express
The built-in http module, why Express exists, routing, middleware pipelines, route parameters, query strings, and sending JSON responses.
F-7
Working with Databases from Node.js
Connecting to PostgreSQL with node-postgres, parameterized queries, SQL injection prevention, and a first look at Prisma ORM.
F-8
Your First Real Application
Building a complete CRUD REST API end-to-end — project structure, error handling, dotenv, nodemon, and testing with curl and Postman.
F-9
Event Emitters & Node's Event-Driven Core
The EventEmitter class, on/emit/once/removeListener, custom events, why streams and HTTP are built on EventEmitter, and memory leak prevention.

Phase 2 — Practitioner

Production patterns · Real application architecture

14 modules
P-1
Application Architecture and Project Structure
Layered architecture (routes → controllers → services → data), feature folders vs layer folders, the service layer pattern, and dependency injection basics.
P-2
Authentication and Authorization
JWT structure, signing and verification, refresh token rotation, bcrypt cost factors, Express auth middleware, session vs stateless — and OAuth 2.0 social login.
P-3
TypeScript in Node.js
tsconfig.json, typing Express handlers and middleware, interfaces vs types, generics, ts-node for dev, tsc for prod — and migrating a JavaScript project incrementally.
P-4
Input Validation, Error Handling, and Middleware Pipelines
Zod for runtime schema validation, custom error classes, Express global error handler, the async wrapper that eliminates try/catch in every route handler.
P-5
Testing Node.js Applications
Unit testing with Jest, integration testing with Supertest, mocking modules, database testing strategies, meaningful coverage, and CI integration.
P-6
Configuration, Security Hardening, and Rate Limiting
12-factor app config, Helmet security headers, express-rate-limit, CORS, HTTPS enforcement, secure cookie flags, and secrets management patterns.
P-7
Connecting External Services and Caching
Redis with ioredis, cache-aside pattern, Nodemailer, file uploads to S3/R2, outbound HTTP with fetch, and idempotent webhook processing.
P-8
Logging, Observability Basics, and Deployment
Structured logging with Pino, correlation IDs, multi-stage Docker builds, docker-compose for local dev, PM2 cluster mode, and GitHub Actions CI/CD.
P-9
WebSockets and Real-Time Communication
WebSocket protocol vs HTTP, Socket.IO rooms and namespaces, Server-Sent Events, long polling, and scaling real-time across processes with the Redis adapter.
P-10
REST API Design and OpenAPI Documentation
REST constraints and resource modeling, versioning strategies, cursor vs offset pagination, OpenAPI 3.0 spec, Swagger UI — designing APIs that don't need a changelog.
P-11
GraphQL with Apollo Server
Schema definition language, queries/mutations/subscriptions, resolvers, the N+1 problem and DataLoader, auth in GraphQL — and when to choose GraphQL over REST.
P-12
Background Jobs and Task Queues with BullMQ
Why job queues exist, BullMQ with Redis, workers and concurrency, retries and exponential backoff, dead letter queues, cron jobs, and real-world use cases.
P-13
JSON Internals, Serialization, and Schema Validation
JSON.parse/stringify edge cases, streaming JSON for large payloads, JSON Schema with Ajv, MessagePack as a binary alternative, and the serialization cost at scale.
P-14
Dockerizing Node.js Applications for Production
Multi-stage builds, Alpine vs slim images, node_modules inside containers, non-root users, health checks, docker-compose, SIGTERM graceful shutdown (draining in-flight requests, closing DB pools, flushing log buffers), and the production readiness checklist.

Phase 3 — Architect

Engine internals · High-throughput systems · Distributed architecture

23 modules
A-0
Mental Model Reset: The Non-Blocking Ingestion Pipeline
The bridge from Phase 2 to Phase 3 — why thread-per-request models and standard Express patterns collapse under a UPI festival spike, and what the Node.js Reactor Pattern actually does.
A-1
V8 Engine Mechanics & Zero-Allocation Ingestion
Ignition/TurboFan pipeline, hidden class instability under millions of payloads, and GC pause elimination for sustained ingestion throughput.
A-2
Memory Leak Prevention Patterns
The four patterns behind 95% of Node.js memory leaks: event listener accumulation (on() without off() per request), closure scope retaining large objects, unbounded in-memory caches without TTL/LRU, and circular reference traps — with WeakRef/WeakMap solutions and a Jest-compatible memory leak test pattern.
A-3
Event Loop Saturation & Thread Pool Offloading
The math behind event loop lag, microtask queue starvation, and UV_THREADPOOL_SIZE tuning for cryptographic validation at scale.
A-4
Kernel-Level I/O Multiplexing: epoll, kqueue, IOCP
The raw network stack: how a transaction payload travels from NIC to Node.js runtime boundary via epoll and libuv.
A-5
The HTTP/TCP Subsystem & Ingestion Backpressure
Implementing backpressure when upstream ingestion velocity outpaces downstream write capacity — socket floods, TCP buffers, and the drain event contract.
A-6
Native Streams & Off-Heap Buffer Storage
Processing gigabytes of transactional logs without V8 heap saturation — Buffer internals, Transform stream pipelines, and zero-copy ingestion.
A-7
Core Scaling: Multi-Process Clustering & IPC Latency
cluster vs worker_threads, SharedArrayBuffer ring buffers for zero-copy IPC, and parallelising transaction signature verification.
A-8
Routing Engines at Scale: Vanilla HTTP vs Radix Tree Frameworks
Why Express middleware chains collapse under extreme throughput and how Fastify's Radix tree router with compiled JSON Schema achieves 3x gains.
A-9
The Modern Hybrid Monolith: High-Throughput Modulith Architecture
Eliminating internal network hops with strict in-memory domain boundaries, isolated state modules, and low-latency internal event emitters.
A-10
Pragmatic Microservice Deconstruction: Splitting Ingestion from Analytics
When to decouple — the outbox pattern, datastore split strategies, and transitioning a write-heavy module out of the monolith without data loss.
A-11
High-Performance IPC: gRPC, Kafka & Event Streams
Protocol Buffers vs JSON-over-HTTP, Kafka consumer group mechanics for 500K msg/sec, and event sourcing for UPI transaction ledgers.
A-12
Enterprise Architecture for State-Heavy Systems: DDD & Clean Architecture
Aggregates, invariants, Ports & Adapters, and CQRS applied to banking ledgers — keeping domain logic clean under extreme architectural complexity.
A-13
Production Observability, Performance Profiling & Flame Graphs
ELU as a first-class metric, clinic.js toolchain, V8 CPU profiles, core dump analysis, and distributed tracing across Kafka-connected services.
A-14
Advanced Connection Pooling & Process Management
PM2 graceful reload, pg-pool sizing mathematics, Redis Cluster client configuration, and Kubernetes liveness vs readiness probe implementation.
A-15
Edge Runtime Ingestion & V8 Isolates
Zero-cold-start globally distributed intake proxies — workerd internals, Cloudflare Workers constraints, and when NOT to use Edge Runtime.
A-16
Resiliency Runbooks & High-Load Security Defenses
ReDoS mitigation, memory exhaustion payload attacks, event loop saturation runbooks, and cascade failure recovery for financial infrastructure.
A-17
Zero-Trust Runtime Architecture & The Node.js Permission Model
Runtime supply chain defense, --allow-fs-read capability delegation, and isolating execution contexts against compromised dependencies.
A-18
Distribution & Cold Starts: Single Executable Applications & V8 Snapshots
Compiling Node.js systems to SEA, v8.startupSnapshot for near-zero cold starts, and secure asset bundling via sea.getAsset().
A-19
Crossing the Boundary: Rust, N-API, and WASI for Cryptographic Throughput
When V8 hits its ceiling — zero-copy Buffer handoff via napi-rs, and WASI sandboxing for deterministic cryptographic operations.
A-20
The Modern Web Standard Shift: Undici, fetch, and Web Crypto
Native fetch socket pool mechanics, Web Crypto vs libuv thread pool, and profiling ReadableStream memory leaks under RPC load.
A-21
Automated Post-Mortem Diagnostics: process.report
Structured JSON diagnostic reports at the exact moment of failure — integrating into SRE pipelines without the overhead of full core dump analysis.
A-22
HTTP/2, gRPC Transport, and Protocol Selection
HTTP/2 multiplexing vs HTTP/1.1 head-of-line blocking, Node.js http2 module, Fastify HTTP/2 setup, server push for resource preloading, gRPC over HTTP/2 with Protocol Buffers, h2c (cleartext) vs h2 (TLS), and the protocol selection decision matrix: REST/HTTP1.1 vs REST/HTTP2 vs gRPC vs WebSocket vs SSE by latency, payload size, and client type.

© 2026 Jatin Jain Saraf (JJS). All rights reserved.