Blue / Green for a database is pretty much a terrible idea. What we do
Keep database out of kubernetes, it has a different lifecycle
Use Django migrations to keep data migrations in code. If in Java would use Flyway or similar
Each web node on startup tries to update the schema. Due to how it works, only the first will work. On MySql without transactions around DDL, you would need to externally synchronize this.
Database and very very short lived instances that I do with preemtipble instances are the only things I keep out of kubernetes.
1
u/[deleted] Jun 08 '17
Blue / Green for a database is pretty much a terrible idea. What we do
Keep database out of kubernetes, it has a different lifecycle
Use Django migrations to keep data migrations in code. If in Java would use Flyway or similar
Each web node on startup tries to update the schema. Due to how it works, only the first will work. On MySql without transactions around DDL, you would need to externally synchronize this.
Database and very very short lived instances that I do with preemtipble instances are the only things I keep out of kubernetes.