Goal: Distribute requests across a dynamic set of nodes with minimal disruption when nodes are added/removed.
How: Hash the request (e.g., user ID or session ID) and place it on a ring. Then route it to the next clockwise node.
Goal: Route requests from the same client (usually with the same session) to the same backend worker (app server).
How:
Use cookies or IP address or session ID to identify clients.
Use a map/cache internally to remember which client is mapped to which worker.
Sticky sessions can use consistent hashing as a strategy, but they don’t have to. Typically, sticky sessions use a map or hashMap of session ID -> worker.