Lesson 4.2

Schema migrations without downtime

A migration runs against a live application. Expand, migrate, contract lets you change a schema while both old and new code are running.

Duration
32m
Level
Intermediate
Students
5.7k students

Overview

A migration runs against a live application. Expand, migrate, contract lets you change a schema while both old and new code are running.

In this lesson you will:

  • Apply the expand, migrate, contract pattern
  • Avoid locks that block writes on large tables
  • Make every migration reversible or forward-only on purpose

Resources

PostgreSQL documentation

The official reference for the tools used in this lesson.