You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to provide atomic updates of DB schemas + applications (preventing out-of-sync db/app updates), it would be very nice to have a feature to embed the migrations into the built executable.
Shipping the migrations does not mean updates to the database schema are "atomic". The database and your application are still distributed, so without some kind of locking mechanism to synchronize, there will always be a time where one or the other is ahead. Moving the migration data itself closer to the application doesn't solve for that. The typical advice is to be careful when migrating that you're always backwards compatible at each step, so that you can smoothly upgrade the application and schema step-wise without any downtime. Sometimes that's not possible and you need to go into a maintenance period where the application needs to be taken offline when the migration is happening to avoid data corruption or runtime issues.
What bundling migrations does do is simplify some setups where getting the migration data in place to run migrations is made easier by bundling it with the application. However, with EdgeDB, since migrations typically happen via the CLI (as opposed to sqlx where you might use the Migrator struct in your app code) I don't think this solves anything for EdgeDB-specific use cases. If we had first-class support for migrating from your application code, I think this bundling pattern makes sense to have.
Hi Scott, thanks for the feedback. We actually have a fleet of machines where we would like each machine to have an instance of EdgeDB and an application deployed together. That's why I was asking for the "atomic" updates via bundling, so when I update the app, the DB update happens seamlessly. Do you have any recommendation for this flow/architecture?
In order to provide atomic updates of DB schemas + applications (preventing out-of-sync db/app updates), it would be very nice to have a feature to embed the migrations into the built executable.
Something along the lines of https://docs.rs/sqlx/latest/sqlx/macro.migrate.html.
I've seen several discussions and requests on this on Discord, but I didn't fully understand what is the roadmap on this.
Thanks!
The text was updated successfully, but these errors were encountered: