Design a Load Balancer Using Consistent Hashing
viaLeetCode
Problem: Design a load balancer that distributes incoming requests across multiple servers such that each server receives roughly equal load.
Design: Discuss rate-limiting-adjacent approaches (token bucket, leaky bucket) as a warm-up, then focus on request-distribution: normal hashing (hash(key) % N) breaks badly on server-count changes (mass rehashing), whereas consistent hashing places servers and request-keys on a hash ring so only a fraction of keys remap when a server joins/leaves. Cover virtual nodes for even distribution, and how primary/secondary indexing on the backing store interacts with routing.
asked …