Safely Migrate a Database

Safely Migrate a Database

How to rename a column on 500 million rows without taking the app down

What you'll learn

  • Why a one-line schema change can take an app down
  • The expand and contract pattern, step by step
  • Backfilling in small batches without hurting replicas
  • How online schema change tools copy and swap a table

In this video, we'll look at how to rename a column in a table with 500 million rows without taking your app offline. We'll cover the expand and contract pattern, writing to both columns, backfilling data in small batches, and switching from the old column to the new one without breaking anything.

We'll also look at why some schema changes can block reads and writes, how old and new code run side by side during a deploy, and how online schema change tools help with large tables.

By the end, you'll know how to plan a database migration without taking your app down.

More videos

32 short explainers so far, with more on the way

View all videos

Join the Community

roadmap.sh is among the top 10 most starred projects on GitHub and is visited by hundreds of thousands of developers every month.

Top 10 out of 28M!

371K

GitHub Stars

Star us on GitHub
Help us reach #1

+90kevery month

+3.2M

Registered Users

Register yourself
Commit to your growth

+2kevery month

52K

Discord Members

Join on Discord
Join the community

RoadmapsGuidesFAQsYouTube

roadmap.shby@nilbuild

Community created roadmaps, best practices, projects, articles, resources and journeys to help you choose your path and grow in your career.

© roadmap.sh·Terms·Privacy·

ThewNewStack

The top DevOps resource for Kubernetes, cloud-native computing, and large-scale development and deployment.