Backend Systems · Cluster
Request Handling
Servers, middleware, and connection lifecycle.
- 01 The Accept Loop: From listen() to an Accepted Connection What the kernel does between the TCP handshake and a readable socket, why listen() takes a backlog argument, and how accept wakeups distribute work across processes.
- 02 HTTP/1.1 Message Framing and the Cost of Connection Reuse How a server decides where one HTTP message ends and the next begins, why chunked encoding exists, and what persistent connections change about failure handling.
- 03 Route Matching Precedence and the Cost of Ambiguity How a dispatcher chooses one handler among overlapping patterns, why specificity beats registration order, and where percent-decoding changes which route wins.
- 04 Middleware Composition and Why Order Changes Behaviour What a middleware chain actually is at runtime, which orderings the mechanism forces, and how buffering middleware breaks streaming responses.
- 05 Thread-per-Connection, Event Loops, and the Cost of Blocking What a blocked read consumes in each concurrency model, why readiness notification changes the shape of the code, and where each approach fails under load.
- 06 Reading Request Bodies Without Holding Them in Memory How to consume a request body as a stream, what backpressure means at the socket, and where size limits, decompression, and multipart parsing go wrong.
- 07 Header Limits, Deadlines, and Slow-Connection Defence Why an attacker who sends one byte a second ties up more than CPU, how absolute deadlines differ from per-read timeouts, and what limits a server has to count.
- 08 HTTP/2 Stream Multiplexing and Flow Control on the Server How independent streams share one TCP connection, why flow control is owed at two levels, and what per-connection compression state costs a server.
- 09 Graceful Shutdown and the Ordering of Connection Draining The sequence a server must follow to stop without dropping requests, why a closed listening socket resets queued connections, and how drain deadlines are sized.
- 10 Proxy Boundaries, Forwarded Headers, and the Hop-by-Hop Contract Which headers stop at an intermediary, how the client address is reconstructed without trusting the wrong hop, and why framing disagreement produces smuggling.