Node.js Internals & Backend Services
V8, the Event Loop, Streams & Backpressure, Native HTTP & Diagnostics
7 modules, 35 lessons: V8 Engine & Node.js Architecture; The Event Loop & Scheduling; Buffers, Binary Data & Crypto; Streams, Pipelines & Backpressure; Async File System & Concurrency; Native HTTP, HTTPS & HTTP/2; Diagnostics & Production Hardening.
Advanced · 2 hours · 35 lessons · 35 labs
Who it is for
Advanced level.
For JavaScript or TypeScript developers who build backend services and want to understand what runs underneath their code: the event loop, streams, memory and HTTP.
What you don't need yet:
- You don't need to read C: libuv and V8 are explained in plain terms
- You don't need to know Docker or Kubernetes yet
- Nothing to install: every lab runs in an online sandbox
What helps:
- Working JavaScript or TypeScript
- Comfort typing commands in a terminal
Before you start:
- Working JavaScript or TypeScript (the TypeScript course covers the typed side)
- Comfort in a terminal
Take first:
- Production TypeScript — Intermediate
Take next:
- Production Full-Stack Engineering — Advanced
Learning paths:
Nobody needs to know everything before they start. Each course builds on the one before, so a learning path takes you there step by step.
Labs
35 labs, 35 of them graded: you write the code, it runs, and graded labs check the result. The outline lists each lesson's labs.
What is free
Start free: First module free with an account. Pro: Every course, lab, handbook, practice exam and certificate.
- Pro monthly — $29 a month. Every course, lab, handbook, practice exam and certificate
- Pro yearly — $249 a year. Every course, lab, handbook, practice exam and certificate
Course outline
V8 Engine & Node.js Architecture
- V8 Engine & JIT Pipeline: Bytecode & Turbofan (1 lab): You can describe how Google V8 parses JavaScript into bytecode via Ignition and optimizes hot loops into machine code via TurboFan.
- libuv Architecture: Event Demultiplexer & Thread Pool (1 lab): You can explain how libuv abstracts OS-level asynchronous I/O across platforms and orchestrates thread pool workers for blocking system calls.
- Node.js Process Architecture: Memory & Heap Spaces (1 lab): You can inspect and monitor process memory structures including Resident Set Size, V8 heap spaces, external ArrayBuffers, and garbage collection behavior.
- Native Module Systems: ESM Loader Hooks vs CommonJS (1 lab): You can explain how Node.js resolves and executes ECMAScript Modules and CommonJS, and how customization loader hooks intercept module resolution.
- Runtime Configuration: CLI Flags & Native --env-file (1 lab): You can configure the Node.js runtime using command line flags, process arguments, and native .env file loading without third-party dependencies.
The Event Loop & Scheduling
- Event Loop Lifecycle: The Six Phases & libuv uv_run (1 lab): You can trace the execution lifecycle of the libuv event loop across its six distinct phases and describe how uv_run orchestrates asynchronous callbacks.
- Microtask Queues: process.nextTick vs Promise Timing (1 lab): You can explain the priority hierarchy between process.nextTick, Promise microtasks, and macrotasks, avoiding event loop starvation.
- Timers Phase: setTimeout, Min-Heap Scheduling & Drift (1 lab): You can explain how libuv schedules timers using a min-heap, calculate and mitigate timer drift, and cancel active handles with clear and unref.
- Poll & Check Phases: I/O Callbacks & setImmediate (1 lab): You can explain how the poll phase retrieves I/O events, blocks when idle, and transitions directly to the check phase for setImmediate execution.
- Close Phase & Signal Dispatch: Sockets & Teardown (1 lab): You can describe how libuv executes close callbacks, dispatches POSIX process signals, and safely tears down active event handles.
Buffers, Binary Data & Crypto
- Buffer Fundamentals: Slab Allocator & V8 Memory (1 lab): You can explain how Node.js manages binary Buffers outside the V8 heap using a slab allocator pool, preventing memory fragmentation.
- Buffer Encodings: UTF-8, Hex, Base64 & Slicing (1 lab): You can transform Buffers across UTF-8, Hex, and Base64 representations, and leverage subarray for zero-copy slicing vs copy mutations.
- Binary Data Manipulation: TypedArrays & Endianness (1 lab): You can parse multi-byte binary structures using DataView and TypedArrays, handling Big-Endian and Little-Endian byte orders explicitly.
- Cryptographic Primitives: node:crypto & Ciphers (1 lab): You can execute cryptographic operations including SHA-256 hashing, HMAC signatures, and authenticated AES-256-GCM symmetric encryption using node:crypto.
- Native Compression: node:zlib & Streaming Codecs (1 lab): You can perform high-performance compression and decompression using node:zlib with Gzip and Brotli algorithms across in-memory buffers and streaming pipelines.
Streams, Pipelines & Backpressure
- Stream Mechanics: Readable Streams & Flowing Modes (1 lab): You can construct and manage Node.js Readable streams, controlling flowing and paused execution modes and consuming data via async iteration and event handlers.
- Writable Streams: Drain Events & highWaterMark (1 lab): You can configure Writable streams, tune highWaterMark limits, detect write backpressure thresholds, and safely resume transmission using drain event listeners.
- Backpressure Engineering: Handling Mismatched I/O (1 lab): You can design and diagnose streaming systems with mismatched producer and consumer speeds, managing backpressure to maintain constant memory consumption.
- Transform Streams: Custom Packet Decoding & Codecs (1 lab): You can implement custom Transform streams to parse fragmented binary network data, reassemble delimited or length-prefixed packets, and emit typed objects.
- Stream Pipelines: pipeline, AbortSignal & Teardown (1 lab): You can orchestrate resilient multi-stage stream pipelines using pipeline from node:stream/promises, handle graceful cancellations with AbortSignal, and prevent resource leaks.
Async File System & Concurrency
- Asynchronous File I/O: node:fs/promises & Handles (1 lab): You can perform asynchronous file system operations using node:fs/promises and low-level FileHandle instances with guaranteed descriptor cleanup and zero memory bloat.
- Directory Traversal: Recursive Readdir & fs.watch (1 lab): You can perform recursive directory scans using readdir with Dirent inspection and monitor file system changes using promise-based fs.watch and AbortController.
- Child Processes: spawn, execFile, fork & IPC (1 lab): You can safely execute external processes using spawn and execFile, prevent shell injection attacks, and orchestrate dedicated Node worker processes using fork and IPC channels.
- Worker Threads: worker_threads & SharedArrayBuffer (1 lab): You can offload CPU-intensive tasks using worker_threads, coordinate thread execution, and manage zero-copy lockless data sharing using SharedArrayBuffer and Atomics.
- Thread Pooling: Piscina & CPU-Bound Workload Pools (1 lab): You can design and operate worker thread pools, amortize thread initialization costs, manage task queues, and execute CPU-bound workloads at scale.
Native HTTP, HTTPS & HTTP/2
- Native HTTP Server: Request & Response Lifecycles (1 lab): You can build high-performance HTTP servers using the native node:http module, handle streaming request payloads, emit chunked responses, and manage TCP socket lifecycles.
- Routing & Middleware: Path Parsing & Async Context (1 lab): You can implement path routing, compose middleware pipelines, and track distributed request contexts across asynchronous call stacks using AsyncLocalStorage.
- Native HTTP/2 Protocols: Multiplexed Streams & Push (1 lab): You can design and deploy high-performance HTTP/2 servers and clients in Node.js, managing binary streams, multiplexing requests over single TCP sessions, and tuning flow control.
- Native WebSockets: Bidirectional Real-Time Streams (1 lab): You can implement real-time bidirectional WebSocket servers and clients using native Node.js APIs, manage protocol upgrade handshakes, and parse WebSocket frames.
- TLS & HTTPS Encryption: Certificates & SNI Contexts (1 lab): You can configure production TLS contexts enforcing modern ciphers, manage multi-tenant certificates with Server Name Indication (SNI), and validate certificates.
Diagnostics & Production Hardening
- Global Error Trapping: uncaughtException & Exits (1 lab): You can architect resilient crash-handling strategies using uncaughtExceptionMonitor, manage process exit lifecycles, and prevent corrupted state in production services.
- Native Test Runner: node:test & node:assert/strict (1 lab): You can author comprehensive test suites using node:test and node:assert/strict, assert asynchronous promise errors, and use built-in function mocks and spies.
- Diagnostic Profiling: CPU Profiler & Heap Snapshots (1 lab): You can diagnose performance bottlenecks, capture CPU profiles, and analyze V8 heap space allocations using node:v8 and the programmatic node:inspector API.
- Cluster Architecture: node:cluster & Zero-Downtime (1 lab): You can scale Node.js web applications across multiple CPU cores using node:cluster, coordinate port sharing, and execute zero-downtime rolling worker restarts.
- Production Hardening: Graceful Shutdown & Docker (1 lab): You can engineer production-ready Node.js container images, handle SIGTERM and SIGINT operating system signals, coordinate graceful request draining, and manage container memory boundaries.