cadence-workflow / cadence

Cadence is a distributed, scalable, durable, and highly available orchestration engine to execute asynchronous long-running business logic in a scalable and resilient way.
https://cadenceworkflow.io
MIT License
8.35k stars 805 forks source link

Automatic Schema upgrade support for production docker #2696

Open samarabbas opened 5 years ago

samarabbas commented 5 years ago

Current recommendation for using Cadence docker is to not enable automatic schema upgrade. Schema upgrades are always applied out of band to underlying database before rolling out Cadence upgrade to the cluster. This issue is to allow schema upgrades to cluster as part of regular Cadence upgrade automatically. All schemas are versioned and schema upgrade could be applied to database when service comes up. We do need to address race condition to make sure schema upgrades are safe if performed from multiple hosts.

mfateev commented 5 years ago

Ideally we want to ensure atomicity of an update as well as the update script can fail in the middle of its execution.

mingfang commented 5 years ago

This tool may be useful https://github.com/golang-migrate/migrate.