An overview of how blue-green deployments work (with AWS examples)
HTML-код
- Опубликовано: 14 дек 2024
- Sharing how we implemented a blue green deployment on our project.
------------
🤑 Patreon / webdevjunkie
🔔 Newsletter eepurl.com/hnderP
💬 Discord / discord
📁. GitHub github.com/cod...
Hi there, perhaps this functionality wasn't around 2 years ago, but you can experiment with API Gateway stages. I have a Blue and Green stage that Route53 will point too. Blue Stage will point to my blue lambdas and Green Stage will point to my Green Lambdas. Minor Change, but at least you don't have to recreate another gateway, and doing it that way also enables canary deployments.
Awesome stuff, keep the AWS/system design content coming!
Most cases we do have database schema change with new versions. I think in that case this pattern does not fit, or rather some sort of downtime is to be planned. Am I correct or is there a pattern which is solving the database schema updates too?
there is a separate pattern you need to do related to breaking database schema changes. Google expand + contract migrations. As an example, if you need to rename a column, you'd:
1. add the new field
2. have your code write to both old and new fields
3. write a script to move all data's old field into new field (some background process)
4. deploy code to now read + write only from the new field
5. run migration to remove the old field
very informative
Does it make sense to do this "Switching" on DNS level? Personally I try to prevent DNS for anything like this because it's so unpredictable. I mean, even if your TTL is 1 second, users their machines can do whatever they want. It's more of a suggestion. I've never tried it but I'd be afraid of breaking prod because caches. You've never run into problems with this?
I personally do something similar but I have sort of like a proxy that redirects traffic to the new machine after health checks have passed. You have complete control of the proxy and does not depend on any caches you don't control.
Good job babe!!
Hello 👋