Backend Engineering

How do I design, build, scale, secure, debug and operate the backend of a real production system? Not how to create an endpoint — what happens from the moment a request reaches your service until data is returned, persisted, queued, cached, retried, observed and served reliably at scale.

Your path through Backend Engineering

0 of 56 Foundation lessons done
0 of 200 lessons done overall
Start: What a Backend Actually Is →

Then follow the stages in order

Each stage builds on the ones before it. Labs and simulators sit right after the lessons they exercise. Open a stage to see its lessons. Full roadmap with goals →

  1. Request in, response out0 of 17 lessons done
    1. What a Backend Actually IsFoundation≈ 5 min
    2. The Request LifecycleFoundation≈ 10 min
    3. What the Backend Is Responsible ForFoundation≈ 5 min
    4. The Trust BoundaryFoundation≈ 5 min
    5. Anatomy of an HTTP ServerFoundation≈ 15 min
    6. Request and Response ObjectsFoundation≈ 10 min
    7. Status Codes From the Server's SideFoundation≈ 10 min
    8. Request Bodies and StreamingFoundation≈ 10 min
    9. How a Route Becomes a Function CallFoundation≈ 10 min
    10. Path ParametersFoundation≈ 10 min
    11. Query ParametersFoundation≈ 10 min
    12. Route PrecedenceFoundation≈ 10 min
    13. What a Handler Is Responsible ForFoundation≈ 10 min
    14. The Middleware PipelineFoundation≈ 10 min
    15. The Three ValidationsFoundation≈ 10 min
    16. Transport ValidationFoundation≈ 10 min
    17. Reporting Validation FailuresFoundation≈ 10 min
  2. Structure, data access and who is calling0 of 19 lessons done
    1. Transport, Application, Domain, InfrastructureFoundation≈ 10 min
    2. The Service LayerFoundation≈ 10 min
    3. The Repository LayerFoundation≈ 10 min
    4. Fat ControllersFoundation≈ 10 min
    5. Dependency Management Without the ContainerFoundation≈ 10 min
    6. Business ValidationFoundation≈ 10 min
    7. Parse, Do Not ValidateFoundation≈ 10 min
    8. Choosing a Data Access LayerFoundation≈ 10 min
    9. What an ORM Actually DoesFoundation≈ 10 min
    10. Middleware Ordering Is a Correctness DecisionFoundation≈ 10 min
    11. Authentication in a BackendFoundation≈ 10 min
    12. Credentials and Password HandlingFoundation≈ 10 min
    13. Session AuthenticationFoundation≈ 10 min
    14. Token Authentication and the Revocation ProblemFoundation≈ 10 min
    15. Authorization in BackendsFoundation≈ 10 min
    16. Authentication vs AuthorizationFoundation≈ 10 min
    17. Where the Check BelongsFoundation≈ 10 min
    18. Role-Based Access ControlFoundation≈ 10 min
    19. Object-Level AuthorizationFoundation≈ 10 min
  3. Transactions, queries, caches and other people's APIs0 of 20 lessons done
    1. Transactions from Application CodeFoundation≈ 10 min
    2. Where the Transaction Boundary GoesFoundation≈ 10 min
    3. One Transaction or TwoFoundation≈ 10 min
    4. External Calls Inside a TransactionFoundation≈ 10 min
    5. What an ORM Buys and What It CostsFoundation≈ 5 min
    6. The N+1 Query ProblemFoundation≈ 10 min
    7. Eager Loading and BatchingFoundation≈ 10 min
    8. Query BuildersFoundation≈ 10 min
    9. Raw SQL in Application CodeFoundation≈ 10 min
    10. Connection PoolsFoundation≈ 15 min
    11. Caching in BackendsFoundation≈ 10 min
    12. Cache-AsideFoundation≈ 10 min
    13. Cache InvalidationFoundation≈ 10 min
    14. TTL and ExpiryFoundation≈ 10 min
    15. When Not to CacheFoundation≈ 10 min
    16. Calling Something You Do Not ControlFoundation≈ 10 min
    17. TimeoutsFoundation≈ 15 min
    18. Serialization: Objects to BytesFoundation≈ 10 min
    19. Three Models, Not OneFoundation≈ 10 min
    20. Schema LeakageFoundation≈ 10 min
  4. Work that outlives the request0 of 19 lessons done
    1. Request or Background?Intermediate≈ 10 min
    2. Background JobsIntermediate≈ 10 min
    3. Job QueuesIntermediate≈ 10 min
    4. Queue SemanticsIntermediate≈ 10 min
    5. Scheduled JobsIntermediate≈ 10 min
    6. Dead-Letter QueuesIntermediate≈ 10 min
    7. Commands vs EventsIntermediate≈ 10 min
    8. Event-Driven BackendsIntermediate≈ 10 min
    9. Naming EventsIntermediate≈ 10 min
    10. Writing Event ConsumersIntermediate≈ 10 min
    11. Inbound WebhooksIntermediate≈ 10 min
    12. Webhook Signature VerificationIntermediate≈ 10 min
    13. Outbound WebhooksIntermediate≈ 10 min
    14. Choosing an Upload PathIntermediate≈ 10 min
    15. File Uploads Through the BackendIntermediate≈ 10 min
    16. Presigned URLsIntermediate≈ 10 min
    17. Object StorageIntermediate≈ 10 min
    18. What Happens After the Bytes LandIntermediate≈ 15 min
    19. Serving FilesIntermediate≈ 10 min
  5. Timeouts, retries, idempotency and limits0 of 20 lessons done
    1. RetriesIntermediate≈ 15 min
    2. Backoff and JitterIntermediate≈ 10 min
    3. Circuit BreakersIntermediate≈ 10 min
    4. BulkheadsIntermediate≈ 10 min
    5. Rate LimitingIntermediate≈ 10 min
    6. Rate Limit AlgorithmsIntermediate≈ 10 min
    7. Idempotency in BackendsIntermediate≈ 10 min
    8. Idempotency KeysIntermediate≈ 10 min
    9. The Idempotency Key FlowIntermediate≈ 15 min
    10. Idempotency StorageIntermediate≈ 15 min
    11. At-Least-Once DeliveryIntermediate≈ 10 min
    12. Duplicate DetectionIntermediate≈ 10 min
    13. Job IdempotencyIntermediate≈ 10 min
    14. Webhook IdempotencyIntermediate≈ 10 min
    15. Webhook Retries and OrderingIntermediate≈ 10 min
    16. Backend RacesIntermediate≈ 10 min
    17. Optimistic ConcurrencyIntermediate≈ 10 min
    18. Pessimistic LockingIntermediate≈ 15 min
    19. Atomic OperationsIntermediate≈ 10 min
    20. Resource LimitsIntermediate≈ 15 min
  6. Observability, testing, security and performance work0 of 22 lessons done
    1. An Error Taxonomy That Maps Cause to ResponseIntermediate≈ 10 min
    2. Error Boundaries: Three Translations, Not OneIntermediate≈ 10 min
    3. Not Leaking Your InternalsIntermediate≈ 10 min
    4. Correlation Ids That Survive Every HopIntermediate≈ 10 min
    5. What a Backend Should Actually LogIntermediate≈ 10 min
    6. Structured LoggingIntermediate≈ 10 min
    7. The Metrics a Backend Must EmitIntermediate≈ 10 min
    8. Tracing From the Backend's SideIntermediate≈ 10 min
    9. Health Checks: Startup, Readiness, LivenessIntermediate≈ 10 min
    10. Configuration: Separating Code From EnvironmentIntermediate≈ 10 min
    11. Secrets Are Not ConfigurationIntermediate≈ 15 min
    12. Validate at Startup, Fail LoudlyIntermediate≈ 10 min
    13. A Test Strategy Chosen by What Each Layer Can ProveIntermediate≈ 10 min
    14. Test Against the Real DatabaseIntermediate≈ 10 min
    15. Contract Tests Between ServicesIntermediate≈ 10 min
    16. Performance Testing a BackendIntermediate≈ 10 min
    17. The Backend Security ChecklistIntermediate≈ 10 min
    18. SQL InjectionIntermediate≈ 10 min
    19. Command InjectionIntermediate≈ 10 min
    20. SSRF — When the Backend Fetches a URLIntermediate≈ 10 min
    21. Secrets in LogsIntermediate≈ 10 min
    22. What Serialization CostsIntermediate≈ 10 min
  7. Scaling out and shipping without dropping requests0 of 20 lessons done
    1. Stateless ServicesAdvanced≈ 5 min
    2. Making an Existing Service StatelessAdvanced≈ 10 min
    3. Horizontal vs Vertical ScalingAdvanced≈ 10 min
    4. Load Balancing, From the Backend's SideAdvanced≈ 10 min
    5. Sticky SessionsAdvanced≈ 10 min
    6. Autoscaling a BackendAdvanced≈ 15 min
    7. Read Replicas From the ApplicationAdvanced≈ 10 min
    8. Pagination That Survives a Large TableAdvanced≈ 15 min
    9. Deployment ModelsAdvanced≈ 10 min
    10. Containerizing a BackendAdvanced≈ 10 min
    11. Graceful ShutdownAdvanced≈ 15 min
    12. Rolling DeploymentsAdvanced≈ 10 min
    13. Expand and Contract MigrationsAdvanced≈ 10 min
    14. Schema Migrations from the Application SideAdvanced≈ 10 min
    15. Running Two API Versions in One ServiceAdvanced≈ 10 min
    16. Mapping Services Across Cloud ProvidersAdvanced≈ 15 min
    17. Running a Backend on KubernetesAdvanced≈ 10 min
    18. Serverless BackendsAdvanced≈ 10 min
    19. Choosing a RuntimeAdvanced≈ 10 min
    20. Backend Runtime ModelsAdvanced≈ 15 min
  8. Distributed patterns, failure handling and multi-tenancy0 of 21 lessons done
    1. The MonolithAdvanced≈ 10 min
    2. The Modular MonolithAdvanced≈ 10 min
    3. MicroservicesAdvanced≈ 10 min
    4. Comparing Backend ArchitecturesAdvanced≈ 10 min
    5. Synchronous vs Asynchronous CommunicationAdvanced≈ 10 min
    6. Failure PropagationAdvanced≈ 10 min
    7. Cascading FailureAdvanced≈ 10 min
    8. The Dual Write ProblemAdvanced≈ 10 min
    9. The Transactional OutboxAdvanced≈ 10 min
    10. Eventual Consistency in PracticeAdvanced≈ 10 min
    11. Keeping a Search Index in SyncAdvanced≈ 10 min
    12. Multi-TenancyAdvanced≈ 10 min
    13. Tenant IsolationAdvanced≈ 15 min
    14. Attribute-Based Access ControlAdvanced≈ 10 min
    15. BackpressureAdvanced≈ 10 min
    16. Worker ScalingAdvanced≈ 10 min
    17. Local vs Distributed CacheAdvanced≈ 10 min
    18. Cache StampedeAdvanced≈ 10 min
    19. Unbounded ConcurrencyAdvanced≈ 10 min
    20. Request CoalescingAdvanced≈ 10 min
    21. Deadlocks in Application CodeAdvanced≈ 15 min
  9. Production backend engineering0 of 42 lessons done
    1. Debugging a Backend in ProductionAdvanced≈ 10 min
    2. Why Is My API Slow?Advanced≈ 10 min
    3. The Common Backend FailuresAdvanced≈ 10 min
    4. Backend Code SmellsAdvanced≈ 10 min
    5. Deploys Are the First SuspectAdvanced≈ 10 min
    6. Memory Leaks in Backend ServicesAdvanced≈ 10 min
    7. Retry StormsAdvanced≈ 10 min
    8. Connection Pool ExhaustionAdvanced≈ 10 min
    9. Queue BacklogAdvanced≈ 10 min
    10. Blocking the Event LoopAdvanced≈ 10 min
    11. The Node Event LoopAdvanced≈ 10 min
    12. Python Runtime ModelsAdvanced≈ 10 min
    13. Worker ProcessesAdvanced≈ 10 min
    14. C++ Backend ServicesAdvanced≈ 10 min
    15. Canary DeploymentsAdvanced≈ 10 min
    16. Blue-Green DeploymentsAdvanced≈ 10 min
    17. Feature Flags: Rollout, Kill Switches and DebtAdvanced≈ 10 min
    18. Defence in DepthAdvanced≈ 10 min
    19. Dependency SecurityAdvanced≈ 10 min
    20. Keep-Alive and Connection ReuseAdvanced≈ 10 min
    21. Accepting ConnectionsAdvanced≈ 10 min
    22. Parsing HTTPAdvanced≈ 10 min
    23. Deserialization: Bytes to ObjectsAdvanced≈ 10 min
    24. Every Input SurfaceAdvanced≈ 15 min
    25. Database ConstraintsAdvanced≈ 10 min
    26. When the Repository Is Just IndirectionAdvanced≈ 10 min
    27. Alternatives to LayeringAdvanced≈ 10 min
    28. What Belongs in the PipelineAdvanced≈ 10 min
    29. Request Context PropagationAdvanced≈ 15 min
    30. The Error BoundaryAdvanced≈ 10 min
    31. Authenticate First, or Rate-Limit First?Advanced≈ 15 min
    32. Where Sessions LiveAdvanced≈ 10 min
    33. OAuth and OIDC From the Backend SideAdvanced≈ 10 min
    34. API KeysAdvanced≈ 10 min
    35. Email and NotificationsAdvanced≈ 15 min
    36. Backend and Its NeighboursAdvanced≈ 5 min
    37. The Backend Reasoning LoopAdvanced≈ 5 min
    38. What an Agent Adds to a BackendAdvanced≈ 10 min
    39. A Tool Call Is a Backend CallAdvanced≈ 10 min
    40. Agent AuthorizationAdvanced≈ 10 min
    41. Budgets, Deadlines and Step LimitsAdvanced≈ 10 min
    42. Agent Audit LogsAdvanced≈ 10 min
The question this domain answers

How do I design, build, scale, secure, debug and operate the backend of a real production system?

Every lesson here starts from a requirement someone actually asked for, shows the implementation that comes to mind first, and then shows how that implementation behaves at 3 a.m. under load with a dependency degrading. The obvious build is obvious for a reason — it is also where production failures come from.

The reasoning loop every lesson carries
Requirement→API Contract→Application Logic→Data Access→External Deps→Concurrency→Failure→Security→Observability→Deployment→Scale

The order is the argument. What the contract promises decides what must be synchronous; what must be synchronous decides what belongs in a transaction; what is in a transaction decides what can safely be retried. Skip a step and you get a design that is locally reasonable and globally wrong.

This is the integration domain

Backend Engineering does not own the depth. It owns the point where the depth meets a running service that someone is paged for.

Upstream

API Design decides the contract: the resource model, the status codes, the versioning story, what the caller is promised. That is a different question from this one.

Here

This domain builds and runs the service behind that contract — the handler, the transaction, the pool, the queue, the retry, the deploy, the log line you will read during the incident.

Downstream

Databases, Security, Performance, Cloud, OS & Networking and Computer Architecture each own a layer in full. Lessons here teach the application-side mechanism and hand the rest off by name.

Almost nothing here is universal. The same choice is correct on one runtime, at one scale, with one team, and wrong a step away. Every claim carries a scope label saying what it is specific to and where a different stack would differ — that label is the difference between a rule and a rule that happens to hold on your machine.

Flagship experiences

The parts of this domain that are not reading.

Follow the Request →

POST /orders from the client through DNS, TLS, the proxy, the runtime, middleware, the router, authorization, the handler, the transaction, the queue and back. Every hop is a separate participant, and every one of them can fail on its own.

Build a Production API →

A real /checkout endpoint, step by step — with the hard question asked at each step before the answer is given. Where does the transaction end? What if payment times out? What if the commit succeeds and the publish does not?

Scale From 1 to 1M →

Ten rungs, and each one appears only when a problem forces it. Read the problem first: a capability adopted without the problem that justifies it is cost with no benefit.

Break the Backend →

Inject a fault and read the signals. Several different faults raise p99, so p99 diagnoses nothing — the exercise is finding the signal that tells them apart.

Follow One Request to Hardware →

The cross-domain spine: your handler, the driver, the socket, the syscall, the scheduler, the cache hierarchy, the core. You do not need this daily. You need it when the numbers stop making sense.

Decision trees →

Where should this work run, what should it run on, and where does the data belong. Every leaf names what it buys and what it costs.

Why Is My API Slow? →

It was 100 ms and it is now 3 s. Work from the symptom to the cause through deploys, queries, pools, dependencies, the event loop and the queue.

Practice challenges →

Production situations with the cause unlabelled. Each one carries the trap — the wrong fix that looks right and makes the next incident worse.

Interview guide →

What each question is really testing, what a strong answer sounds like, and the red flags that separate a remembered rule from a working model.

Learning modules

Twenty-eight modules, from what a backend actually is once the framework is removed to debugging one at 3 a.m.

200 lessons →
Backend Fundamentals7

What a backend actually is once the framework is removed: the request lifecycle end to end, which responsibilities belong to the server because they cannot be trusted to the client, and why every input from outside the process is untrusted.

HTTP Servers7

What a server does between a socket and a response: accept, parse, build a request object, route, execute, serialize, write bytes. The part frameworks hide most completely.

Backend Runtime Models7

Event loops, threads, workers and processes — the runtime model decides what "slow" means for your service. Taught as concurrency models rather than framework slogans.

Routing & Handlers6

How a method and a path become a function call, how precedence resolves ambiguity, and what a handler should and should not be responsible for.

Middleware6

The pipeline every request passes through, why its order is a correctness decision and not a style one, and how cross-cutting concerns compose without leaking into handlers.

Application Layering7

Service layers, repositories and the transport/application/domain/infrastructure split — including when each is genuine structure and when it is ceremony that adds indirection without behaviour.

Validation & Trust7

Three different validations that are routinely confused: is this well-formed, is this allowed by the business, and is this consistent with what the database already holds.

Serialization & DTOs5

Turning runtime objects into bytes and back, what that costs in CPU and allocation, and why the database row is the wrong thing to hand a client.

Authentication7

Establishing who is calling: credentials, sessions, tokens, OAuth and API keys, from the backend's side of the problem rather than the protocol's.

Authorization8

Deciding what the caller may do — role-based, attribute-based, and the object-level check whose absence is the most common serious backend vulnerability there is.

Database Access9

ORM, query builder or raw SQL as an engineering decision with consequences, plus the query patterns and pool limits that decide how a backend behaves under load.

Transactions7

Which operations belong in one atomic unit, why a network call inside a transaction is a resource problem, and what to do when a commit and a message must both happen.

Caching7

Cache-aside, invalidation, stampedes and the local-versus-distributed decision — including the cases where a cache adds a consistency problem and buys nothing.

Background Jobs & Queues10

Work that does not belong in the request path: deciding what to defer, the queue lifecycle from enqueue to dead-letter, and what happens when producers outrun consumers.

Events6

Commands ask for something to happen; events state that it did. What that distinction changes about coupling, naming, consumers and the consistency of everything downstream.

External Dependencies9

Every call leaving your process can be slow, wrong or absent. Timeouts, retries, backoff, circuit breakers, bulkheads and the rate limits you both enforce and obey.

Webhooks5

Inbound HTTP you do not control: signature verification on the raw payload, duplicate delivery as the normal case, and ordering you cannot assume.

Idempotency6

The property that makes retries safe. Keys, storage, scope and expiry — and the difference between a queue delivering once and your business logic acting once.

Backend Concurrency7

Two requests, one row. Optimistic versioning, pessimistic locks, atomic operations, and the bounded-resource thinking that keeps a burst from becoming an outage.

Errors & Observability9

An error taxonomy that maps causes to responses, boundaries that stop internals leaking, and the logs, metrics and traces that let you answer questions you did not anticipate.

Files & Object Storage6

Uploads that do not go through your process, the bucket/key/object primitive underneath every provider's SDK, and what still has to happen after the bytes land.

Configuration & Testing8

What belongs in code versus runtime configuration, why secrets are a separate problem, and a test strategy chosen by what each layer can actually prove.

Deployment10

Shipping a running service without dropping requests: containers, graceful shutdown, health checks, rolling deploys and migrations that survive two versions at once.

Scaling Patterns7

Statelessness, load balancing, autoscaling signals, pagination, batching and streaming — the specific techniques, and the problem each one is a response to.

Backend Security7

The checklist every service owes: injection, SSRF, dependency risk, secrets discipline and defence in depth, from the implementer's side rather than the attacker's.

Backend Architecture7

Monolith, modular monolith, microservices and event-driven, compared honestly — with the distributed-systems costs that arrive the moment a function call becomes a network call.

Production Debugging8

The API was 100 ms and is now 3 s. Working from symptom to cause through deploys, queries, pools, dependencies, the event loop and the queue.

Agent-Enabled Backends5

A model choosing a tool is a client choosing an endpoint. Authorization, budgets, timeouts and audit still belong to the backend, not to the prompt.

Reference

For when you already know roughly what you are looking for.