came up during IRIS call with Zac, Joel, Julian & Robb - This is Robb's write-up on the matter.
- Blue-Green deployment: two Production ASGs & ELBs
- only one is live at any time (Route53 Alias)
- standby ASG can be deployed-to (rollforward or rollback), warmed-up (scaling, caching ,etc), and verified (smoke tests, etc. aginst
standby.us-east-1.iris.tv
) BEFORE being made live - Route53 API ChangeResourceRecordSets are transactional
- Post-swap, the newly standby ASG can be updated to 0 desired instances (min and max = 0 too).
- DNS changing is how AWS Elastic Beanstalk works too (
SWAP CNAME
API call). - Route53 Alias queries are free
- This opens up possibilities for Route53 Latency-based routing (i.e. hosting from multiple AWS Regions)
- See also this write-up from thoughtworks.com on the various techniques for blue-green deployment with AWS, ELB, EIP, ASGs, Route53, etc.
+--------------------+
| DNS |
| |
| CNAMEs (TTL 300): |
| api.iris.tv |
| api-lat.iris.tv |
| api*.iris.tv |
| |
+---------+----------+
|
|
|
live.us-east-1.iris.tv
|
|
v
+----------------------------+
| Route53 |
| |
| Route53 Alias RR |
| live.us-east-1.iris.tv |
| standby.us-east-1.iris.tv |
| |
+------+--------------+------+
| |
| |
| |
| |
| |
| |
| |
+-------standby Alias-------+ +---live Alias----+
| ^ ^ |
| | | |
| | +-----------------+ | |
| +---------+ SWAP TO GO LIVE +-------+ |
| | (Route53 API) | |
v +-----------------+ v
+-------------------------------------------------------+ +-------------------------------------------------------+
| ELB | | ELB |
| production-blue-746907157.us-east-1.elb.amazonaws.com | | production-green-23882388.us-east-1.elb.amazonaws.com |
| | | |
+-----------------------+-------------------------------+ +-----------------------+-------------------------------+
| |
| |
| |
| |
+---------+--------+ +--------+---------+
| ASG | | ASG |
| production-blue | | production-green |
| | | |
+------------------+ +------------------+