0

I'm following this procedure to deploy new application versions to EC2. When the new version proves stable, I update the A record of the DNS entry to route the traffic to the IP address of the new server.

I guess this is not the best practice, especially because you can't be sure when all your visitors' DNS cashes have updated the entry so that you can take the old version offline.

Are there any best practices for this? Do I have to create an own server with its own IP address where I can configure the routing (expensive)? Or can I utilize the service of my hosting provider to do that? Or is there an AWS-specific solution?

Joe
  • 189
  • 4

2 Answers2

1

There are lots of different ways to do a seamless deployment of a new version of an app.

To use your existing method, you'd just want to make sure you have the TTLs lowered for your DNS records before doing the changeover.

  • Change TTL to 5 minutes
  • Wait the total period of the original TTL value
  • Make DNS change
  • Changes should be updated for most resolvers once the 5 minute TTL expires

Not completely seamless, but pretty common.

phoebus
  • 8,380
  • 1
  • 31
  • 30
1

OK, this is a quite old question, which I'm first seeing now...

I update the A record of the DNS entry to route the traffic to the IP address of the new server.

You're correct, that will result in a unknown percentage of your users still going to the old application version, due to DNS caching. If you follow phoebus' solid suggestion, it probably will be very few users -- but still, there is a better way on AWS.

Or is there an AWS-specific solution?

Yes, and I mentioned it in my original answer which you linked to.. Amazon's Elastic IP Addresses if you're using just a single IP address per service; or Elastic Load Balancing if you're using a fleet of servers.

Elastic IP's generally switch over in a couple of seconds, less than 10 secs in my experience.