hashing

Table of Contents

Hashing

Clients Load Balancer Servers
[ ] 11 % 4 = 3 -->[ ]-----------> []
[ ] 12 % 4 = 0 -->[ ]-----------> []
[ ] 13 % 4 = 1 -->[ ]-----------> []
[ ] 14 % 4 = 2 -->[ ]-----------> []

If you don't send requests to the same server, we get cache misses.

[ ] 11 % 5 = 1 -->[ ]-----------> []
[ ] 12 % 5 = 2 -->[ ]-----------> []
[ ] 13 % 5 = 3 -->[ ]-----------> []
[ ] 14 % 5 = 4 -->[ ]-----------> []
[ ] 15 % 5 = 0 -->[ ]-----------> []
            D  C1
        , - ~ ~ ~ - ,
     , '               ' , C4
   ,                       , A
  ,                         ,
 ,                           ,
 ,                           , C3
 ,                           ,
  ,                         ,
   ,                       ,
     ,                  , '
 C     ' - , _ _ _ ,  ' B
             C2
            D  C1    E
        , - ~ ~ ~ - ,
     , '               ' , C4
   ,                       , A
  ,                         ,
 ,                           ,
 ,                           , C3
 ,                           ,
  ,                         ,
   ,                       ,
     ,                  , '
 C     ' - , _ _ _ ,  ' B
             C2

Rendezvous Hashing

This is a generalized for of Consistent Hashing, which can deal with the range of N = 1 to Infinity.

Prev: [load-balancers](load-balancers.html) Next: [relational-databases](relational-databases.html)