~/talk

Adding zero-downtime migrations strategy in SaaS project

Talkat PyCon Italia 2024 · 2024-05-22..05-25· [databases, devops-and-delivery]
links:none on file
slides:none on file

Global goal: avoid maintenance windows that can cost up to $66,000 per minute; achieved by making the database compatible with older code rather than forcing old code to change. Uses Django migrations on PostgreSQL and Saleor’s deployment flow with expand and contract pattern: add new columns, backfill via post_migrate background tasks (asynchronous workers process batches, transactional updates with locks), then switch app versions and finally drop old columns. Works for large datasets (millions) by batching, stopping task workers during schema apply, then resuming to finish backfill; only single-version hops are zero-downtime.

AI-written summary · about

  1. 0:00Introduction and problem
  2. 2:56Problematic database operations
  3. 12:12Expand and contract pattern
  4. 21:20Version upgrade process
  5. 24:55Q&A session
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.