Alembic Textbook Ch. 8 — Production Patterns and Recovery
Production Alembic: deploy strategies, recovery from broken migrations, stamp, manual fixes, and the operational checklist.
Production Alembic: deploy strategies, recovery from broken migrations, stamp, manual fixes, and the operational checklist.
Cheatsheet: K8s Job vs app-startup, advisory-lock single runner, forward-only, recovery via stamp.
Cheatsheet: PgBouncer, read replica routing, OTEL instrumentation, multi-tenancy (RLS), DR / failover.
Production SQLAlchemy: pool sizing with PgBouncer, read replica routing, OTEL instrumentation, multi-tenancy with RLS, and graceful failure modes.
Production FastAPI: Uvicorn / Hypercorn / Granian, Dockerfile, K8s deployment, HPA, graceful shutdown, and the operational checklist.
Pre-launch checklist: deps, config, observability, security, data, deployment, on-call.
An end-to-end guide to deploying Django to production: app server, reverse proxy, database, static files, env config, security hardening, and what to monitor.