0

My goal is to be able to route traffic from Route53 to my autoscaling group using relatively complex rules. Route 53 must provide DNS, and my EC2 instances must service the request, but I'm open to any other technologies being used in the stack.

Here's an example of the rules I might like to use:

  • 1% of traffic with a specific value in the url path should be routed to ASG A
  • 0.1% of traffic with this value in the body should be routed to ASG B
  • Rest should go to ASG C

What is the best solution for me considering that I want to be able to change the rules without deploying new CF template every time (my entire configuration is in CF)?

The main reason is to be able to run experiments for specific clients. I want to be able to deploy a new feature to production, test it on a specific audience and only then make it generally available. For some clients, I will be able to use query parameters but for some, I will need to scan the request body.

If there is a different solution (without multiple ASGs) or something that I didn't even think about please share your ideas.

1
  • I've updated your question based on comments on your previous question and the answer I've now deleted. If the question isn't accurate please edit it.
    – Tim
    Dec 14, 2018 at 6:50

2 Answers 2

1

HAProxy can route traffic based on the body of a request.

You could try:

  • Route53 directs all traffic to a cluster of HAProxy instances.
  • HAProxy routes traffic to the various AWS load balancers (ELB / ALB rather than auto scaling groups) by CNAME based on your criteria URL / body / anything else
  • Load balancers change auto scaling group size based on your auto scaling group

This isn't really a cloud native way of doing things, and it makes the HAProxy instances a bottleneck and point of failure. You'd at least want them in multiple AZs, and ideally if you have critical applications you'd have a couple of clusters in different regions.

In your place I'd consider running the experiments using application layer, or by doing routing based on some factor that's simpler such as URL or a cookie. If you search for techniques for blue/green deployment that might give you some more ideas for splitting traffic.

I don't think this is quite a full answer yet, but it should give you some ideas. I'll ponder this a bit more and may have more for you in the next day or so. Maybe someone else can give you a better answer before then.

1

There would be a sequence of three load-balancing phases, the first feeds to second which feeds to the third:

  1. The "multi-AZ" phase: an ordinary ELB
  2. The "audience" phase: Each AZ contains your own custom load-balancer (like haproxy on EC2):
    • 1% send to backend A
    • 0.1% send to backend B
    • else send to backend C
  3. The "auto-scaling" phase. Each of A, B, C is yet another ELB. Each feeds its own auto-scaling group.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .