I've read the AWS docs regarding Deploying Versions with Zero Downtime, aka CNAME swapping.
As yegor256 explains it in this answer:
The only thing that it does is just exchanging of two CNAMEs. For example, you have one environment foo-1 with CNAME foo-1.example.com, and another one foo-2 with CNAME foo-2.example.com. After swap operation environment foo-1 will respond at http://foo-2.example.com.
So the problem is, you're not switching the whole traffic straight away, but only the new traffic. Existing traffic will continue to use the previous CNAME entry for up to TTL seconds, making two versions coexist for this short period of time (300 seconds, or more according to Arun Kumar).
This looks acceptable to me when two versions of the application can cohabit.
However, some releases of our app include database patches, that must be run right after the old version has been taken out, and right before the new version is brought in.
So it looks like CNAME swapping is just not good enough for what we're doing, as the old app version would break after the database has been patched.
Ideally, I'd like to:
This would minimize the downtime to just a few seconds of 503 Service Unavailable
, only when there are patches to apply.
Is that possible? Or did I not see the whole picture properly, and am I missing a simpler solution?
To maintain full capacity during deployments, you can configure your environment to launch a new batch of instances before taking any instances out of service. This option is known as a rolling deployment with an additional batch.
Elastic Beanstalk isn't great if you need a lot of environment variables. The simple reason is that Elastic Beanstalk has a hard limit of 4KB to store all key-value pairs. The environment had accumulated 74 environment variables — a few of them had exceedingly verbose names.
In AWS Elastic Beanstalk, you can create a load-balanced, scalable environment or a single-instance environment.
Here are some other strategies that you can use to perform zero-downtime deployment on Elastic Beanstalk: http://www.hudku.com/blog/demystified-zero-downtime-with-amazon/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With