hal-platform / hal

:shipit: Hal Deployment Platform - Web UI/API
MIT License
18 stars 4 forks source link

Consider how to handle safer database migrations #20

Open skluck opened 7 years ago

skluck commented 7 years ago

There is a pattern that large systems use to handle data migration with zero time - Typically this involves a multi-step migration process:

  1. Add redundant tables or columns and begin writing to both
  2. Switch over reads to the new table/structure
  3. Stop writing to the old structure
  4. Delete the old structure

Etsy and Stripe have written about their experiences with this:

Hal currently uses the doctrine ORM for database management. We need to investigate if using such a pattern is even possible with it. Ideally migrations can happen safely and reliably enough that they can occur while using Continuous Deployment. Not only would this improve our own instance, but also provide a better experience to people using the open source version of Hal.