Home / Companies / PlanetScale / Blog / Post Details
Content Deep Dive

Backward compatible database changes

Blog post from PlanetScale

Post Details
Company
Date Published
Author
Taylor Barnett
Word Count
2,355
Company Posts That Month
11
Language
English
Hacker News Points
18
Post removed?
No
Summary

A common practice is to separate database schema changes from application code changes to minimize risk. Coupling these changes can lead to issues such as double deployment risks, blocking the development pipeline, and increased migration time. The expand, migrate, and contract pattern provides a safe approach to making changes by expanding the schema first, then writing to both old and new schema in the application, migrating data, reading from the new schema, contracting the application, and finally deleting the old column or table. This process involves five steps, each with its own specific task, such as adding a new column, updating the application code, running a data migration script, updating the application to read from the new schema, and contracting the changes. The pattern is designed to ensure backward-compatible changes, reduce risk, and minimize downtime or disruptions for users.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.