Mustafa Magdy
Mustafa Magdy

Reputation: 1330

EF db migrations with rolling/canary deployments

I have a .NET application that is using EF Core as ORM, and all db modifications are done using Db Migrations in EF.

The application is hosted on the cloud on multiple VMs in production, after do all testing, a rolling deployment is initiated to take one VM at a time, deploy the new application, and so on.

The database itself hosted on managed Db service (Like aws RDS, Azure SQL) with multi-az/replication setup.

The main goal, is to make sure there is no downtime (0 downtime), and rollback if any issue happened (or manually distribute canary weighted requests accordingly)

the main issue is, if application successfully deployed to one instance, and that instance receives a connection, this will cause the database to be migrated to the new version, causing all other instances requests to fail (as EF will have different migrated db in the old instances)

Upvotes: 2

Views: 794

Answers (0)

Related Questions