← Courses
⚙️

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 at 2K–50K TPS on blockchain indexers and UPI payment networks.

46 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

~16.5 hrs

across 46 modules

Built from

2K–50K 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

15 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.
P-15
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.

Phase 3 — Architect

Engine internals · High-throughput systems · Distributed architecture

22 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
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-3
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-4
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-5
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-6
Core Scaling: Multi-Process Clustering & IPC Latency
cluster vs worker_threads, SharedArrayBuffer ring buffers for zero-copy IPC, and parallelising transaction signature verification.
A-7
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-8
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-9
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-10
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-11
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-12
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-13
Advanced Connection Pooling & Process Management
PM2 graceful reload, pg-pool sizing mathematics, Redis Cluster client configuration, and Kubernetes liveness vs readiness probe implementation.
A-14
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-15
Resiliency Runbooks & High-Load Security Defenses
ReDoS mitigation, memory exhaustion payload attacks, event loop saturation runbooks, and cascade failure recovery for financial infrastructure.
A-16
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-17
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-18
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-19
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-20
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-21
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.