- Designing YouTube
The first case study here that is not a transactional system: nobody contends for a video, and the difficulty is bytes. Resumable uploads, transcoding as a fan-out of keyed tasks, and the cache split that makes a 99% edge hit rate reachable — then advertising as part of the playback path, server-side against client-side insertion, impression billing that has to be exactly once, and the recommendation and campaign machinery that gets a video watched.
- FastAPI – Background Tasks and Their Limits
BackgroundTasks runs work after the response is sent, which is the entire feature. What that buys, what it emphatically is not — no retry, no persistence, no visibility — and when to reach for a real queue instead. Then the trap that makes it dangerous: a yield dependency closes BEFORE the task runs, so passing an ORM object half-works, and the half that fails is the half you add later.
- FastAPI – File Uploads Without the Holes
UploadFile, streamed in chunks rather than read into memory, with a size limit enforced during the write because there is no trustworthy length beforehand. Then the three guards an upload endpoint needs: content sniffed from the bytes rather than trusted from a header the client typed, a generated filename because "../../app/main.py" is a valid one, and no partial file left behind on failure.
- AWS – CloudWatch: Logs, Metrics and Alarms Worth Having
Log groups, retention that defaults to never expire and quietly bills you forever, and Logs Insights queries that find the error instead of scrolling to it. Metrics and the difference between a missing datapoint and a zero — which is what makes an alarm lie. Alarms that page a human versus alarms that trigger a rollback, and the handful actually worth creating on day one.
- FastAPI – OAuth2 and Sign in with Google
The authorization code flow with PKCE, built end to end: why OAuth2 is not a login protocol, what state actually defends against, and the one if statement that stands between a sign-in button and an account takeover. Plus the token endpoint that makes the Authorize button on /docs work, and how to test a flow that leaves your network.