A 26-chapter engineering reference
Backend, from first principles.
Most backend material teaches a framework. This teaches the machinery underneath it — what an HTTP request actually is, why a connection pool has the size it has, what a broker guarantees and what it does not. Every chapter is a self-contained field manual with diagrams and runnable Go and Python.
- Chapters
- 26
- Languages
- Go · Python
- Format
- Theory + code
- Progress
- 0 / 26
The Request Path
How bytes on a socket become a handled request.
01–07
0 / 7
- 01HTTP & CORSA first-principles walkthrough of the application-layer protocol every backend touches, from statelessness and method semantics to caching, conditional requests, proxies, and TLS. Written to explain not just what each piece does but why it exists and how it works underneath. Implementations in Go, Python, JavaScript, TypeScript and Java, grounded in MDN and RFC 9110.3-4 hoursCompleted
- 02Routing in BackendHTTP methods describe the what of a request, your intent. Routing describes the where : which resource on the server your intent is aimed at. This manual covers routing end to end, static and dynamic routes, path and query parameters, nesting, versioning, and catch-alls, with worked routers in Go, Python, JavaScript, TypeScript and Java.2-3 hoursCompleted
- 03Serialization & DeserializationA JavaScript client and a Rust server have nothing in common at the level of data types. Serialization is how they talk anyway: both convert their native data to and from one agreed format for the trip across the network. This manual covers the whole idea, the language barrier, the common standard, text vs binary formats, JSON in depth, the OSI mental model, and the full client<->server round-trip, with worked code in Go, Python, JavaScript, TypeScript and Java.2-3 hoursCompleted
- 04Authentication & AuthorizationA first-principles walkthrough of the two ideas every backend touches every single day, who are you (authentication) and what can you do (authorization). From wax seals and shared secrets to sessions, JWTs, cookies, OAuth 2.0, OpenID Connect, and RBAC. Written to explain not just what each piece does but why it exists and how it works underneath. Implementations in both Go and Python.3-4 hoursCompleted
- 05Validations & TransformationsA first-principles walkthrough of the rules and guidelines you keep in mind while designing APIs, the gate every piece of client data passes through before any business logic runs. Why it exists, where it lives, how it works underneath, with complete implementations in Go and Python shown side by side.2-3 hoursCompleted
- 06Controllers, Services & MiddlewaresA first-principles walkthrough of how a single HTTP request travels inside your server, through routing, the three architectural layers, the middleware chain, and the request context that ties it all together. Complete implementations in Go, Python, JavaScript, TypeScript and Java shown side by side.2-3 hoursCompleted
- 07API Design (REST)REST isn't a technology you install, it's a set of agreements that let millions of clients and servers talk without coordinating. This chapter takes the standard apart, rebuilds it from the scalability crisis that created it, and turns every fuzzy question (plural or singular? PUT or PATCH? which status code?) into a rule you never have to guess about again.3-4 hoursCompleted
State & Machinery
Where data lives, and the moving parts around it.
08–14
0 / 7
- 08DatabasesInteracting with a database is the single most frequent thing a backend engineer does. This chapter builds the whole picture from the ground up, why databases exist at all, why they live on disk, how to model real relationships, how to query them safely and fast, and the two performance levers (indexes and triggers) that separate a toy from production. Everything is grounded in one running example: a project-management platform.2-3 hoursCompleted
- 09CachingUnderstanding the mechanism that makes high-performance backend systems fast, from Google Search to Netflix to Redis.2-3 hoursCompleted
- 10Task Queues & Background JobsWhy slow work belongs outside the request, and how a task queue moves it there: brokers, producers and consumers, retries and backoff, visibility timeouts, idempotency, worker rate limiting, monitoring, and workflow engines. Worked implementations in Go, Python, JavaScript, TypeScript and Java.3-4 hoursCompleted
- 11Full-Text Search (Elasticsearch)Why ILIKE '%term%' cannot use an index and what to do instead: the inverted index, BM25 relevance scoring, fuzzy matching, and when Postgres full-text search is enough versus when you need Elasticsearch. Worked implementations in Go, Python, JavaScript, TypeScript and Java.2-3 hoursCompleted
- 12Error Handling & Fault ToleranceEvery backend fails; the difference is whether it fails loudly and recoverably or silently and expensively. The five classes of error, failing fast at startup, deep health checks, retries with backoff and jitter, one global handler at the edge, and what a client must never be told. Worked implementations in Go, Python, JavaScript, TypeScript and Java.2-3 hoursCompleted
- 13gRPC & Inter-Service CommunicationA first-principles walkthrough of the RPC framework that powers the internals of Google, Netflix, Uber and most modern microservice fleets, from the contract (Protocol Buffers) and the binary wire format , through the HTTP/2 transport and the four streaming shapes, to deadlines, interceptors, mTLS and production resilience. Written to explain not just what each piece does but why it exists and how it works underneath. Implementations in Go, Python, JavaScript, TypeScript and Java.3-4 hoursCompleted
- 14Configuration ManagementThe DNA of your application, how the same code behaves differently across environments without ever touching the codebase.2-3 hoursCompleted
Running in Production
Keeping it observable, secure and fast under load.
15–20
0 / 6
- 15Logging & ObservabilityYou cannot fix what you cannot see. The three pillars, logs, metrics and traces, what each one answers that the other two cannot, and how to wire all three into a service so a 3am page leads to the actual broken line. Worked implementations in Go, Python, JavaScript, TypeScript and Java.2-3 hoursCompleted
- 16Graceful ShutdownTeaching your backend good manners, how to finish ongoing work, clean up after itself, and close the door politely instead of slamming it shut.2-3 hoursCompleted
- 17Backend SecurityAlmost every attack is the same mistake: data from a user being treated as code or as trusted. Injection, password storage, session cookies, rate limiting, BOLA and BFLA, XSS and CSRF, security headers, OAuth/OIDC and TLS, each one built from the attack backwards. Worked implementations in Go, Python, JavaScript, TypeScript and Java.2-3 hoursCompleted
- 18Scaling & Performance (Part 1)What "fast" actually means and how to make it so: latency percentiles, throughput and queuing, finding the real bottleneck with profilers and traces, then the four fixes that account for most wins, N+1 queries, indexes, connection pooling and caching. Worked implementations in Go, Python, JavaScript, TypeScript and Java.2-3 hoursCompleted
- 19Scaling & Performance (Part 2)Scaling past one machine: statelessness as the thing that makes instances interchangeable, load balancer algorithms and health checks, read replicas and sharding, CDNs and the edge, offloading work to queues, and the honest trade-offs of microservices and serverless. Worked implementations in Go, Python, JavaScript, TypeScript and Java.2-3 hoursCompleted
- 20Concurrency & ParallelismWhy a backend spends most of its life waiting, and the four models built to stop wasting that time: OS threads, the event loop, goroutines and virtual threads. Then the bugs concurrency creates, race conditions across a yield point, and the locks and channels that fix them. Compared across Go, Python, JavaScript, TypeScript and Java.2-3 hoursCompleted
Distribution & Scale
Shipping it, testing it, and connecting services.
21–24
0 / 4
- 21Docker, K8s & CI/CDA first-principles walkthrough of how backend code gets packaged and run in production, from the kernel features that make a container (namespaces and cgroups), through Docker images, layers and multi-stage builds, into Kubernetes orchestration (pods, deployments, services, probes, autoscaling), and out to CI/CD pipelines and zero-downtime rollouts. Written to explain not just what each piece does but why it exists and how it works underneath. Application examples in Go, Python, JavaScript, TypeScript and Java.2-3 hoursCompleted
- 22Automated TestingA first-principles walkthrough of how backend engineers verify their systems, from a single unit test and the test-double vocabulary, through integration tests against real databases and HTTP handlers, contract tests between services, end-to-end checks, coverage and flakiness, and into TDD, load testing, and tests in the deployment pipeline. Written to explain not just what each kind of test does but why it exists and how to write it well. Examples in both Go ( testing ) and Python ( pytest ).2-3 hoursCompleted
- 23Message Brokers & KafkaA first-principles walkthrough of the distributed event-streaming platform that backs the nervous systems of LinkedIn, Uber, Netflix and most modern fintech, from the one idea everything rests on (an append-only commit log ), through partitions, consumer groups, offsets and delivery semantics, into retention, schemas, event-driven patterns, the outbox/CDC trick, and stream processing. Written to explain not just what each piece does but why it exists and how it works underneath. Producer/consumer code in both Go and Python.2-3 hoursCompleted
- 24WebSockets & Real-TimeA first-principles walkthrough of real-time backend communication, from why HTTP's request-response shape can't push, through the WebSocket upgrade handshake, frames, and connection lifecycle, into building a server, managing thousands of connections, handling backpressure, and the hard part: scaling stateful connections across many instances with a pub/sub backplane. Written to explain not just what each piece does but why it exists and how it works underneath. Server and client code in both Go and Python.2-3 hoursCompleted
OpenAPI & AI Agents
Production Ready Agentic AI Solutions
25–26
0 / 2
- 25OpenAPI & DocsAn API without documentation is a rumor, not an interface. OpenAPI has become the industry-standard contract language for APIs, turning prose agreements into machine-readable specifications that drive documentation, testing, and code generation. This chapter explains what OpenAPI is, why it exists, how to write a specification, the trade-offs between design-first and code-first workflows, and how to keep the spec and the implementation in sync over time.2-3 hoursCompleted
- 26AI Agents & Loop EngineeringAn AI agent is not a prompt with a loop around it. It is a bounded backend workflow that observes state, chooses an action, uses tools, evaluates the result, and either continues or finishes. This chapter builds that architecture with LangGraph, OpenAI tool calling, sequential and conditional workflows, and the production controls that make agents dependable.2-3 hoursCompleted
Open source
These notes get better when people argue with them.
Found an explanation that hand-waves, an edge case that is missing, or a diagram that is wrong? Chapters are plain Markdown now — a correction is a pull request, not a wrestling match with hand-written HTML. Implementations in other languages are especially welcome.