Area 08 / 08 · API
Backend
Phase 0 + 5 · Weeks 1–2, 18–20Every AI product is a backend with a model inside it.
Models get the attention, but most of an AI product is ordinary backend engineering: APIs, auth, databases, caching, queues and monitoring. Concepts 01–10 are Phase 0, the foundation you need before the LLM area. Concepts 11–20 come back in Phase 5, when you ship: caching, queues, background jobs, rate limits, idempotency, retries, uploads, pagination, validation and observability.
0 of 20 used in code
01–10 · The base
Learn these first.
- 01REST APIsURLs for resources + HTTP methods (GET, POST, PUT, DELETE) to expose your app.
- 02HTTP and Status CodesHow requests and responses work, and what 200, 201, 400, 401, 404, 429 and 500 mean.
- 03Async and AwaitHandle many slow calls (like LLM requests) at the same time without blocking.
- 04Streaming with SSEServer-Sent Events push tokens to the browser over one HTTP connection.
- 05WebSocketsA two-way live connection, for voice, real-time chat and collaboration.
- 06Authentication with JWTSigned tokens that prove who the user is on every request.
- 07OAuth 2.0‘Login with Google’, and letting your app act on a user’s account with their permission.
- 08SQL vs NoSQLTables with relations and joins vs flexible documents or key-value. Choose by the shape of your data.
- 09Database IndexingIndexes make lookups fast. Know which columns your queries need indexed.
- 10Transactions and ACIDGroup writes so they all succeed or all fail, and your data stays consistent.
11–20 · Production level
Come back after you have shipped something.
- 11Caching with RedisKeep hot data in memory for fast reads and fewer database or LLM calls.
- 12Message QueuesPass work between services reliably (RabbitMQ, SQS, Kafka).
- 13Background JobsRun slow tasks (embeddings, reports, emails) in workers, outside the request.
- 14Rate LimitingCap requests per user or key to protect your app and your LLM bill.
- 15Idempotency KeysA retried request with the same key is processed only once. No double charges.
- 16Retries with BackoffRetry failed calls with growing waits (plus a little randomness) instead of hammering.
- 17File Uploads to S3Store user files in object storage, usually through presigned URLs.
- 18PaginationReturn long lists in pages (limit/offset or cursor).
- 19Input Validation with PydanticDefine request and response shapes in Python. Bad data is rejected automatically.
- 20Logging and MonitoringStructured logs, metrics and error tracking, so you see problems before users report them.
BUILD THIS
A FastAPI service with JWT login, Postgres, a Redis cache, a background worker that ingests documents, rate limiting, and an SSE endpoint that streams LLM answers.
Project guide →