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

Automated migrations with periodic metric checks

Blog post from Contentful

Post Details
Company
Date Published
Author
Farruco Sanjurjo
Word Count
1,918
Language
English
Hacker News Points
-
Summary

The current process of running database migrations had limitations, including relying on a single engineer to monitor metrics across multiple instances, keeping track of migration status, and only allowing migrations during office hours. To address these issues, a new approach was developed using a `metrics service` that delegates work to `metric providers`, which can be specific to one metrics source without changing the `metrics service`. The `migration runner` schedules periodic calls to the `metrics service` to determine if the migration should be stopped or not, and uses signals to control the execution of the migration. This approach allows for more efficient monitoring, 24/7 migration execution, and reduced engineer burden.