Dwarves
Memo
Type ESC to close search bar

Radio Talk 60 Blue Green Deployment

Blue-green deployment has become an important topic in modern software development, and this deployment strategy has become our focus on the tech radar. In a recent radio talk, Quang Le, one of our DevOps engineers, presented the significance of blue-green deployment and its benefits. This memo is a quick recap of the talk.

A brief

Blue-green deployment is a software deployment strategy that involves creating two identical environments: one that is live and serving user traffic (blue) and one that is not (green). The new version of the software is deployed to the green environment, and once the deployment is complete, traffic is switched from the blue to the green environment. This strategy allows for a seamless transition between versions, with reduced downtime, and the ability to roll back to the previous version if needed.

Why it helps

There are several benefits to using blue-green deployment in modern software development:

Q/A

Q: Is it possible to control traffic to each service (x% to the active service and y% to the preview service)?

A: That is possible, but it is no longer a blue-green deployment; it is a canary deployment.

Q: How do I make sure my app works correctly when applying migrations that change the database structure (delete tables or delete columns) or deprecate APIs?

A: When applying migrations or deprecating API, your code must be backward compatible with the currently active version. For example, if you want to rename a certain column, you need to create a migration to create a new column, and change the query and response to the new column. Once the code is released and the new version is active, you can create a migration to delete that column.

Q: When do we need to apply blue-green deployment?

A: It is not recommended to use blue-green deployment at the beginning of a project or when the project does not have many users because it will require a certain effort to set up. It should only be applied to applications with many continuous users or any systems that cannot tolerate disruption, for example, finance.