DjangoCon US 2024: Deploying Django migrations at Kraken scale with Tim Bell

Channel:
Subscribers:
42,400
Published on ● Video Link: https://www.youtube.com/watch?v=SOZudIGUdjs



Duration: 0:00
39 views
0


Kraken is an energy retail system built on Django. It is currently in use by over 20 clients around the world, including the largest energy retailer in the UK, Octopus Energy, which developed Kraken.

When Kraken started out over 8 years ago supporting a single small client, applying Django migrations to make database schema changes was easy. Any migration that might be slightly dangerous was deployed outside business hours when the system was relatively quiet and there was no risk of disrupting the work of customer service staff. Kraken has now grown: the code has around 350 Django apps, with over 9000 migration files between them, and some database tables have billions of rows. With Kraken operating in 8 time zones around the globe, there is now no such thing as "outside business hours". We have needed to find other ways of deploying migrations that might be risky.

There are two main risk factors with applying migrations: taking exclusive database locks, and needing a long time to apply. Exclusive locks can interrupt normal system operations, while slow migrations can hold up the deployment process, potentially preventing later deployments for a long period.

This talk describes how we write migrations so that they avoid risks where possible, and how we deploy them in a scalable way, avoiding the need for manual intervention as much as possible. We describe techniques that use standard features in the Django migration system, as well as a system we have developed to complement standard Django migrations. The techniques described should be generally applicable to most large Django installations.


This talk was presented at: https://2024.djangocon.us/talks/deplo...

LINKS:
Follow Tim Bell πŸ‘‡
On Mastodon: https://chaos.social/@timb07
On X: https://x.com/timb07

Follow DjangoCon US πŸ‘‡
https://fosstodon.org/@djangocon
https://x.com/djangocon

Follow DEFNA πŸ‘‡
https://www.defna.org/


Video Production by Confreaks
Follow Confreaks πŸ‘‡
https://confreaks.com/
https://x.com/confreaks
https://confreaks.bsky.social/




Other Videos By Confreaks


2025-04-07DevOpsDays NYC 2018 - Ignite with Mike Fiedler
2025-04-06DevOpsDays NYC 2018 - Ignite with Jason Yee
2025-04-05DevOpsDays NYC 2018 - Ignite with Heidi WaterHouse
2025-04-04DevOpsDays NYC 2018 - Accelerate DevOps Adoption With A Dojo by Manish Patel
2025-04-03DevOpsDays NYC 2018 - Resolving Outages Faster With Better Debugging... by Liz Fong, Adam Mckaig
2025-04-02DevOpsDays NYC 2018 - Cloud, Containers, Kubernetes by Bridget Kromhout
2025-04-01DevOpsDays NYC 2018 - DevOps Is More About Customer Feedback & Quick Learning... by Kishore Jalleda
2025-03-31DevOpsDays NYC 2018 - Devops, Almost 10 Years - What A Strange Long Trip... (Keynote) by John Willis
2025-03-22DjangoCon US 2024: Closing Remarks with Peter Grandstaff
2025-03-22DjangoCon US 2024: Operations: The Missing Django Piece with Micah Lyle
2025-03-22DjangoCon US 2024: Deploying Django migrations at Kraken scale with Tim Bell
2025-03-21DjangoCon US 2024: Only reliable Data: Protecting Database Integrity with Eva Nanyonga
2025-03-21DjangoCon US 2024: Lessons from E2E Testing Web Applications with Avindra Fernando
2025-03-20DjangoCon US 2024: Optimizing remote work: Pull Requests, Stand-ups, and emojis with Kasey Kelly
2025-03-20DjangoCon US 2024: Pygoat - Learn django security the hard way with Adarsh Divakaran
2025-03-19DjangoCon US 2024: Maps with Django with Paolo Melchiorre
2025-03-19DjangoCon US 2024: PostgreSQL Beyond Django: Strategies to Get Max Performance with Álvaro Justen
2025-03-18DjangoCon US 2024: Open-source Python tools to visualize and analyse ... with Samweli Mwakisambwe
2025-03-18DjangoCon US 2024: One Thousand and One Django Sites with Vince Salvino
2025-03-17DjangoCon US 2024: Passkeys: Your password-free future with Ryan Hiebert
2025-03-17DjangoCon US 2024: Django Ledger | Uniting Developers and Accountants for... with Miguel Sanda