Backend engineering
How production services take a request, prove who sent it, store and move its data, and stay up when parts fail. Hand-drawn units, from HTTP to the complete request.
- unit I · chapter 1 · 9 partsHTTP, TLS and DNS
HTTP messages, methods, idempotency, status codes, caching headers, HTTP/1.1 to HTTP/3, the TLS 1.3 handshake, certificates, and DNS for backend engineers.
- unit II · chapter 2 · 8 partsSame-origin policy, CORS, cookies and CSRF
Origins and sites, the same-origin policy, CORS simple and preflight requests, credentialed CORS and its vulnerabilities, cookie scope and flags, SameSite, and CSRF defences.
- unit III · chapter 3 · 10 partsSessions, passwords, JWT and OAuth
Session authentication and revocation, password hashing and login attacks, password reset, JWT claims, signing, refresh rotation and attacks, OAuth 2.0 flows with PKCE, and OpenID Connect.
- unit IV · chapter 4 · 9 partsAuthorization, validation and multi-tenancy
Default deny and server-side enforcement, RBAC, ACL, ABAC and ReBAC, IDOR and BOLA, policy engines, input validation and its attacks, and multi-tenant isolation and fairness.
- unit V · chapter 5 · 10 partsAPI design and service architecture
REST resources, filtering, offset, cursor and keyset pagination, versioning, idempotency keys, RPC, GraphQL and gRPC, API contracts, layered and hexagonal architecture, error models, testing and code quality.
- unit VI · chapter 6 · 9 partsDatabase access from services
Drivers and connection pools, pool sizing with Little's law, timeouts, parameterized queries, ORM internals and N+1, transactions and isolation in code, pessimistic and optimistic locking, schema migrations, expand and contract, read replicas and PgBouncer.
- unit VII · chapter 7 · 10 partsCaching, Redis and CDNs
Hit ratios and cache layers, cache-aside, read-through, write-through, write-behind and write-around, TTLs, LRU and LFU, invalidation, stampedes, penetration, avalanches, hot and big keys, Redis data structures, internals, persistence, Sentinel and Cluster, and CDN edges.
- unit VIII · chapter 8 · 10 partsQueues, Kafka and event-driven design
Background jobs, brokers, acknowledgements and visibility timeouts, delivery semantics and idempotent consumers, retries and dead-letter queues, Kafka partitions, offsets, replication and transactions, event schemas, event sourcing and CQRS, the transactional outbox, sagas and scheduled work.
- unit IX · chapter 9 · 10 partsConcurrency, runtimes and distributed locks
Processes, threads, event loops and coroutines, pool sizing, race conditions, mutexes, semaphores and compare-and-swap, concurrency across instances, Redis and consensus locks with leases and fencing tokens, the Redlock debate, backpressure and load shedding, memory and resource leaks, and the Node.js and Go runtimes.
- unit X · chapter 10 · 10 partsRate limiting, resilience and integrations
Fixed and sliding windows, token and leaky buckets, distributed and security rate limits, connect, read and overall timeouts, deadline propagation, cascading failures, retry budgets, circuit breakers, bulkheads and degradation, webhooks with HMAC signatures, third-party API integration, and email delivery with SPF, DKIM and DMARC.
- unit XI · chapter 11 · 10 partsProxies, load balancing and production networking
Forward and reverse proxies, forwarded headers and trusted proxies, Nginx's workers, buffering and sendfile, L4 and L7 load balancing and its algorithms, consistent hashing, health checks and draining, NAT, DSR and the PROXY protocol, service discovery, API gateways and service meshes, WireGuard and Tailscale, sockets, ports and NAT tables, and cloud networking.
- unit XII · chapter 12 · 11 partsRealtime, file uploads and search
Polling, long polling, server-sent events, WebSockets and WebTransport, the WebSocket handshake and frames, authentication, backpressure, fan-out, presence and millions of connections, multipart uploads, validation and path traversal, object storage with presigned and multipart uploads, LIKE and trigram search, analyzers, inverted indexes and BM25, Elasticsearch, embeddings, HNSW and hybrid retrieval.
- unit XIV · chapter 14 · 10 partsObservability and production debugging
Structured logs, request ids, redaction and retention, counters, gauges, histograms and cardinality, percentiles and tail latency, traces, spans, context propagation and OpenTelemetry, golden signals, RED and USE, SLIs, SLOs, error budgets and burn-rate alerts, liveness, readiness and startup probes, profiling, flame graphs and load tests, failure scenarios for databases, caches and queues, and a method for debugging production.
- unit XV · chapter 15 · 10 partsDeployment, Kubernetes and the full request
Images, layers, namespaces, cgroups and PID 1, container security, pods, Deployments, Services, Ingress, ConfigMaps, Secrets, volumes, StatefulSets, Jobs and CronJobs, scheduling, requests, limits, probes, CrashLoopBackOff and autoscaling, graceful shutdown, rolling, blue-green, canary and shadow deployments, compatibility and expand-and-contract migrations, feature flags, monoliths and microservices, cloud cost, and one request from DNS to the database and back.