Home / Companies / Octopus Deploy / Blog / Post Details
Content Deep Dive

Automated blue/green database deployments

Blog post from Octopus Deploy

Post Details
Company
Date Published
Author
Bob Walker
Word Count
5,523
Language
English
Hacker News Points
-
Summary

Blue/green deployments offer a strategy for achieving zero-downtime deployments by maintaining two identical production environments, switching between them to minimize risk and ensure seamless transitions. The approach is particularly beneficial for applications that are more stateless and decoupled, though it can be complex when databases are involved. The article presents a detailed scenario involving a Single Page Application with database changes, illustrating the intricacies of implementing a blue/green deployment, especially when altering database schemas, such as combining columns. It emphasizes the importance of removing business logic from the database to facilitate these deployments and recommends several practices, including making non-destructive changes, using scripts to backfill data, and avoiding unnecessary versioning of stored procedures and views. Moreover, it highlights the flexibility that blue/green deployments provide, allowing database changes to be deployed separately from code, potentially reducing risk. However, it notes that this strategy requires careful planning, the right infrastructure, and an alignment of architecture, while also suggesting that the initial investment can lead to more frequent and less disruptive deployments.