Code → runtime → application → system
Backend
How server code executes, how NestJS assembles an application, and how a backend system stays responsive as load and complexity grow.
- Chapters
- 17
- Learning tracks
- 5
- PRODUCTION CASES
- 19
What this sphere covers
Node.js Runtime
Event Loop · libuv · Worker Threads
- CHAPTER 01Event Loop orderStack → queues → phases
Compare synchronous code, nextTick, microtasks, timers, poll, and check in one live run.
- CHAPTER 02Event demultiplexerMany sources → one thread
Start a timer, file read, and DNS lookup together, then observe ready callbacks returning to JavaScript.
- CHAPTER 03Callback queueOne stack, many ready tasks
Five zero-delay timers show how one expensive callback delays the entire queue.
- CHAPTER 04Blocking vs WorkerCPU-bound work
Compare heartbeat gaps and a real HTTP load test with CPU work on main versus a bounded Worker pool.
- CHAPTER 05libuv thread poolHidden parallelism
Six PBKDF2 jobs reveal the native thread-pool queue and the callbacks returning to the Event Loop.
- CHAPTER 07Promises, setImmediate, and BullMQMicrotasks → check → Redis jobs
Practice Promise chains, async/await, combinators, and setImmediate, then follow a real BullMQ job lifecycle through Redis.
- CHAPTER 08Node.js vs Java, Go, and PythonConcurrency model → suitable workload
Learn why Node is efficient for I/O, where the Event Loop advantage ends, and which models Java, Go, and Python provide.
Memory and diagnostics
leaks · closures · GC · heap snapshots
- CHAPTER 06Memory leakRetained references → rising RSS
A controlled leak in an isolated process: watch heap, external, and RSS, release references, and then run GC.
- CHAPTER 09Closures, GC, and heap snapshotsRetainer path → proven cause
Reproduce a leak through a closure or global cache, capture the heap, and find the retention path from payload to GC root.
NestJS
DI · IoC · request lifecycle
- CHAPTER 11NestJS Dependency Injection and IoCModule metadata → tokens → instances
Build a real Nest application context and inspect class, value, factory, alias, singleton, and request-scoped providers.
- CHAPTER 12NestJS request lifecycleMiddleware → policy → handler → outcome
Send real requests through Nest middleware, guards, interceptors, pipes, a controller, service, and exception filter.
Architecture
microservices · caching · System Design
- CHAPTER 13Microservices: boundaries, messages, and failuresCapability → contract → transport
Understand why services are separated, how commands and events cross a network, and which failure modes distributed systems introduce.
- CHAPTER 21Caching in Node.js, NestJS, Redis, and HTTPKey → hit/miss → invalidation
Learn where caching removes repeated work, how cache-aside behaves, and how stale data, stampedes, and unbounded memory cause incidents.
- CHAPTER 25System Design foundationsRequirements → scale → state → failures
Learn to turn product requirements into capacity estimates, data flows, reliability boundaries, and testable trade-offs.
Python and CPython
syntax · objects · GIL · asyncio
- CHAPTER 22Python syntax for a JavaScript developerRead Python without guessing
Learn the minimum syntax, collections, control flow, functions, and module rules needed to read everyday Python code.
- CHAPTER 23Python objects, functions, and protocolsIdentity · classes · generators · errors
Read functions as values, classes, dataclasses, generators, decorators, exceptions, and context managers without importing JavaScript assumptions.
- CHAPTER 24CPython runtime, memory, GIL, and asyncioSource → bytecode → frames → concurrency
Trace how CPython compiles and executes code, owns objects, collects cycles, coordinates threads, and schedules asyncio tasks.