Sticky Sessions Routing for Traffic Distributor
To achieve server affinity, the Sticky Sessions technique sends the user to a certain backend and ensures that they interact with a single version of the application. The consumer is routed according to server weights on their initial visit, and the allocated backend is retained for the user’s subsequent requests, ensuring uniformity.
Typically, this is accomplished by having users memorize their IP addresses, however, this method might become ineffective if a large number of users are using proxies, resulting in an uneven allocation of load. Rather, to provide persistent routing, the platform employs a sophisticated method based on session cookies, which treats every browser as an individual “user” for the more evenly distributed load.
By following predetermined priorities, Sticky Sessions allocates new users in a manner akin to the round robin technique. For A/B testing, for instance, allocating a 50% ratio to each version guarantees an equal number of visits from distinct users. Nevertheless, until their session expires or the cookie is deleted, requests from returning users are always routed to the designated hosts, independent of server weights.
