Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Riak Search: The Next Generation

Tom Santero
September 17, 2013

Riak Search: The Next Generation

Presentation on Yokozuna (https://github.com/basho/yokozuna) at the NYC Riak Meetup group

Tom Santero

September 17, 2013
Tweet

More Decks by Tom Santero

Other Decks in Programming

Transcript

  1. NODE # = HASH(KEY) % NUM_NODES NH(Ka) = 0 NH(Kb)

    = 1 NH(Kc) = 2 NH(Kd) = 0 ... Naive Hashing Tuesday, September 17, 13
  2. NODE 0 NODE 1 NODE 2 Ka Kb Kc Kd

    Ke Kf Kg Kh Ki Kj Kk Km Kl Kp Kn Ko Kq Kr Naive Hashing Tuesday, September 17, 13
  3. NODE 0 NODE 1 NODE 2 Ka Kb Kc Kd

    Kg Ki NODE 3 Ke Kf Kh Kj Kk Kl Km Kn Ko Kp Kq Kr Naive Hashing Tuesday, September 17, 13
  4. K * (NN - 1) / NN => K •

    K = # OF KEYS • NN = # OF NODES • AS NN GROWS FACTOR ESSENTIALLY BECOMES 1, THUS ALL KEYS MOVE Naive Hashing Tuesday, September 17, 13
  5. PARTITION # = HASH(KEY) % PARTITIONS • # PARTITIONS REMAINS

    CONSTANT • KEY ALWAYS MAPS TO SAME PARTITION • NODES OWN PARTITIONS • PARTITIONS CONTAIN KEYS • EXTRA LEVEL OF INDIRECTION Consistent Hashing Tuesday, September 17, 13
  6. P9 P6 P3 P8 P5 P2 P7 P4 P1 NODE

    0 NODE 1 NODE 2 Ka Kb Kc Kd Ke Kf Kg Kh Ki Kj Kk Km Kl Kp Kn Ko Kq Kr Consistent Hashing Tuesday, September 17, 13
  7. P9 P6 P3 P8 P5 P2 P7 P4 P1 NODE

    0 NODE 1 NODE 2 Ka Kb Kc Kd Ke Kf Kg Kh Ki Kj Kk Km Kl Kp Kn Ko Kq Kr NODE 3 Consistent Hashing Tuesday, September 17, 13
  8. NN * K/Q => K/Q • K = # OF

    KEYS • NN = # OF NODES • Q = # OF PARTITIONS • AS K GROWS NN BECOMES CONSTANT, THUS K/Q KEYS MOVE Consistent Hashing Tuesday, September 17, 13
  9. Solr index = riak bucket document = RObj value plaintext,

    JSON, XML Tuesday, September 17, 13