- Newest
- Most votes
- Most comments
I'm afraid this isn't possible with ALB. Sticky session is for binding a client session to specific target, ie. all requests from given client are routed to the same target. ALB. You can configure routing algorithm that selects which target (within the group) the request is routed to, but there is no option to base routing on URL path.
load_balancing.algorithm.type
The load balancing algorithm determines how the load balancer selects targets when routing requests. The value is round_robin, least_outstanding_requests, or weighted_random. The default is round_robin. See https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-target-groups.html#target-group-routing-configuration
I think what you are trying to do is called "sharding". Here is a sample how you could do this with help of Cloudfront Functions that would calculate the shard id based on URL and add that into URL. Then you could configure ALB target groups based on shard id and get request for even and odd documents routed to different tasks like you had in your example.
Relevant content
- asked 2 years ago
- Accepted Answerasked 3 months ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago