惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Full Disclosure
WordPress大学
WordPress大学
小众软件
小众软件
Cloudbric
Cloudbric
AWS News Blog
AWS News Blog
腾讯CDC
量子位
人人都是产品经理
人人都是产品经理
大猫的无限游戏
大猫的无限游戏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
Vulnerabilities – Threatpost
Scott Helme
Scott Helme
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
C
CXSECURITY Database RSS Feed - CXSecurity.com
The Hacker News
The Hacker News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
IT之家
IT之家
Jina AI
Jina AI
Attack and Defense Labs
Attack and Defense Labs
S
SegmentFault 最新的问题
Simon Willison's Weblog
Simon Willison's Weblog
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
T
Tailwind CSS Blog
Last Week in AI
Last Week in AI
博客园 - 【当耐特】
Google Online Security Blog
Google Online Security Blog
美团技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Visual Studio Blog
罗磊的独立博客
L
LINUX DO - 最新话题
博客园 - Franky
博客园 - 叶小钗
Apple Machine Learning Research
Apple Machine Learning Research
The Last Watchdog
The Last Watchdog
J
Java Code Geeks
AI
AI
C
Cisco Blogs
酷 壳 – CoolShell
酷 壳 – CoolShell
C
Cyber Attacks, Cyber Crime and Cyber Security
Cisco Talos Blog
Cisco Talos Blog
博客园 - 三生石上(FineUI控件)
雷峰网
雷峰网
Help Net Security
Help Net Security
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
云风的 BLOG
云风的 BLOG
I
Intezer
S
Securelist

Anže's Blog

The 15-Year-Old iptables Rule That Broke My DNS Fedidevs 9h Outage Postmortem Letting Claude Upgrade My Raspberry Pi Agents Day Lisbon DjangoCon Europe 2026 How to Safely Update Your Dependencies Speeding Up Django Startup Times with Lazy Imports Typing Your Django Project in 2026 Claude Fixes User Bug Jekyll to Hugo Migration Advent of Code 2025 🎄 Django bulk_update Memory Issue Migrating Gunicorn to Granian Disable Network Requests When Running Pytest Disable Runserver Warning in Django 5.2 Autogenerating og:images with Jekyll Power Outages and Gunicorn PID Files UV with Django Go-like Error Handling Makes No Sense in JavaScript or Python Packages Do Not Match the Hashes Pip Error Gotchas with SQLite in Production Fedidevs Dev Update #2 Django SQLite Production Config Django Streaming HTTP Responses Deploying a Django Project to My Raspberry Pi (Video) Thoughts on Code Reviews Django SQLite Benchmark Django, SQLite, and the Database Is Locked Error No Downtime Deployments with Gunicorn SQLite Write-Ahead Logging Writing a Pytest Plugin Fedidevs Dev Update #1 Django-TUI: A Text User Interface for Django Commands Automate Hatch Publish with GitHub Actions Words TUI: App for Daily Writing Textual App Auto Reload Fly.io Certificate Renewal Using Testing Library with Selenium in Python The Fastest Way to Build a Read-only JSON API import __hello__ Enum with `str` or `int` Mixin Breaking Change in Python 3.11 Your Code Doesn't Have to Be Perfect Fixing _SixMetaPathImporter.find_spec() Not Found Warnings in Python 3.10 Upgrading Django App to Python 3.10 Integer Overflow Error in a Python Application Python Dependency Management MySQL Performance Degradation in Django 3.1 New Features in Python 3.8 and 3.9 The Code Review Batch Size The Code Review Bottleneck
RDS Blue/Green Deployments
Anže Pečar · 2023-07-01 · via Anže's Blog

I’ve recently had to upgrade a fairly large MySQL database from 5.7 to 8.0 and I was looking for ways to minimize the downtime of the upgrade. Since the database was hosted on RDS I decided to look into the Blue/Green Deployments feature. This post is a summary of my experience with the feature.

How does it work?

When you create a new Blue/Green deployment RDS creates the new instances based on your existing topology. If you have a primary and a replica it will create a new green deployment with a primary and a replica.

All the data from your blue instances will be replicated into the green instances the same way as data is replicated between primaries and replicas.

Once the green instances are synced up, you can perform operations on the green instances, e.g. upgrade the database version, increase the instance size, run long-running/blocking schema changes, or change settings in the parameter group that requires a reboot. Since your application traffic is still going to the blue instances, you can perform these operations without any downtime.

When the green instance is ready you can switch application traffic from blue to green. When you do this RDS will run the Switchover actions. This will stop new write operations, drop connections, wait for the green instances to catch up, and then perform the renaming of the instances and endpoints. After the renaming is complete, writes to the green instance are enabled. The blue instance is put into read-only mode and the new data coming into the green instance is NOT replicated back into the blue instance.

From your application’s perspective, nothing has changed. The database endpoint URL is still the same as it was before the switch.

How does it perform?

Prior to running the upgrade on the production environment I tested the Blue/Green deployment and compared it with the normal upgrade process using the RDS modify command. I used Locust to generate a constant load of requests to the database.

The normal upgrade method resulted in 4 minutes and 30 seconds of downtime for both read and write operations:

image tooltip here

The Blue/Green deployment resulted in ~1 minute of downtime for writes and ~30 seconds of downtime for reads:

image tooltip here

To put these times into perspective, 4.38 minutes of full downtime is 99.99% or four nines of high availability per month, while 26.30 seconds of full downtime is 99.999% or five nines!

Gotchas

There are some gotchas when doing Blue/Green deployments.

Since Blue/Green deployments create new instances the new instances will have new binlogs. This means that if you are using the binlog to replicate to another database or your data lake you’ll have to reconfigure the replication once you switch from blue to green. This is not a problem that you would face with an in-place upgrade, since the binlog file names would stay the same.

Some configuration from the blue instances does not transfer over to the green instances. For example, green instances are all created with the same parameter group. If you have a different parameter group for your read replica you’ll have to make sure to update the green replica after it’s created. This also goes for any other setting, e.g. the binlog retention period setting that you set with CALL mysql.rds_set_configuration('binlog retention hours', 168);, this setting will also not transfer over to the green instances so you’ll need to set it again once the green instances are created.

Fin

Blue/Green deployments can be a great tool to minimize downtime when upgrading your database. Especially useful if you find yourself needing to upgrade MySQL to 8.0 later this year when MySQL 5.7 reaches end of life October 31, 2023. RDS end of standard support date is December 2023.