Avoiding integer overflows with zero downtime
Buildkite, a Rails majestic monolith with a large PostgreSQL database, recently migrated one of its biggest tables from integer to bigint primary keys to prevent potential integer overflows. The migration process involved adding a new column with the bigger data type, backfilling the new column for existing records, and swapping the columns. ActiveRecord migrations were used for all database changes, ensuring zero-downtime throughout the entire process. Foreign key tables were also updated using similar strategies.
Company
Buildkite
Date published
March 25, 2021
Author(s)
Samuel Cochran
Word count
1004
Language
English
Hacker News points
None found.