DEV Community

Discussion on: Intro to deployment strategies: blue-green, canary, and more

Collapse
 
erikpischel profile image
Erik Pischel

What about db schema migration? How do you handle that?

Collapse
 
sadeqhussain profile image
Sadequl Hussain

Hi Erik,

DB schema migration can be part of any of these approaches too.

  • With Big Bang, the DB schema is changed at the same time the newer version of the application is deployed

  • With Rolling, Blue-Green or Canary, the new app's logic is uses a conditional branching to access a new DB schema which exists side-by-side with old schema. Once the app is fully released, another small change removes that conditional access to DB, so the new DB schema is always accessed.

In terms of how the DB schema is rolled out during deployment, this is done the same way app code is rolled out - via a Continuous Integration path where a package containing both app and database code is deployed.

Hope this answers your question.

-

Collapse
 
mrrycho profile image
mr-rycho

@Sadequl Hussain : but what kind of replication do you use for the two database schemas that both receive inserts and updates from the users? If you have some kind of bidirectional replication how do you prevent the DDL part from the new schema "leaking" too early to the old schema?