New: Cookbooks and AI ExplanationsStep-by-Step recipes to solve problems connected to Roadmaps and Cheat Sheets. Need more details? Use AI buttons for structured and simple explanations with concrete examples throughout the whole platform.Take a look
You need a new required column, but the old version of your app is still serving traffic while the new one rolls out.
What you'll have at the end
A column added as nullable, backfilled, then locked to not-null only after every pod runs the code that writes it
You need
A FastAPI service running behind a Kubernetes Deployment with several replicas, a Postgres table already taking real production traffic, and a rule for working out the new column's value for a row from data the table already holds.
Not covered
Renaming or dropping an existing column, which needs its own dual-write and switch-reads deploys rather than the single expand this recipe uses.
Leans on
Add a required column to a live table without locking it
the full lock-safe walkthrough for the exact constraint technique this recipe only shows in condensed form once it's actually safe to run.
Stop a rolling deploy from cutting off requests mid-flight
if requests themselves are dropping mid-rollout rather than failing on a constraint, that recipe covers the different race between the Service and a terminating pod.
Checked 19 Aug 2026
Part of the Backend Deployment cookbook