What algorithm is best for sticky sessions without breaking even distribution?
Consistent hashing on client session tokens with virtual nodes. This maintains session affinity while distributing traffic evenly and ensuring minimal key reshuffling when backend nodes scale.
Answered in
Traffic Engineering at the Boundary: Load Balancers, Gateways and Reverse ProxiesHow Layer 4 and Layer 7 balancers, edge API gateways, and reverse proxies coordinate to shape, authenticate, and distribute web-scale traffic.
Read the full analysisOther questions this article answers
More system design & architecture questions
- What is the architectural difference between an API Gateway and a Reverse Proxy?
- When should an architecture use Layer 4 instead of Layer 7 load balancing?
- How do edge ingress layers prevent backend cascading thundering herds?
- How can a CDN improve performance for dynamic requests?
- What is the hardest part of operating behind a CDN?
- How can a CDN help with traffic surges or DDoS attacks?
- What is the difference between a Push CDN and a Pull CDN?
- What is the core distinction between database replication and database sharding?
Every answer on Crashtech is written by the editor of the article it comes from — never auto-summarised. Browse all answers or the System Design & Architecture beat.