Unformatted text preview:

Distributed Hash Tables DHTs Distribute partition a hash table data structure across a key value large number of servers CS162 Operating Systems and Systems Programming Lecture 24 Also called key value store DHTs and Cloud Computing April 25 2011 Ion Stoica http inst eecs berkeley edu cs162 Two operations put key data insert data identified by key data get key get data associated to key 4 25 Distributed Hash Tables DHTs cont d Ion Stoica CS162 UCB Spring 2011 Lec 24 2 Distributed Hash Tables DHTs cont d Just need a lookup service i e given a key ID map it to machine n Many lookup proposals CAN Chord Pastry Tapestry Kademlia n lookup key Used in practice Invoking put and get at node m p2p eDonkey based on Kademlia Dynamo Amazon Cassandra Facebook m put key data n lookup key get node n mapping key n store key data store data at node n data m get key n lookup key get node n storing data associated to key return n retrieve key get data stored at n associated to key 4 25 Ion Stoica CS162 UCB Spring 2011 4 25 Lec 24 3 Page 1 Ion Stoica CS162 UCB Spring 2011 Lec 24 4 Challenges Chord Lookup Service System churn machines can fail or exit the system any time Associate to each node and item a unique id key in an uni dimensional space 0 2m 1 Partition this space across N machines Each id is mapped to the node with the smallest largest ID consistent hashing Scalability need to scale to 10s or 100s of thousands machines Key design decision Heterogeneity Properties Decouple correctness from efficiency Latency 1ms to 1000ms Bandwidth 32Kb s to 100Mb s Nodes stay in system from 10s to a year 4 25 Routing table size O log N where N is the total number of nodes Guarantees that a file is found in O log N steps Ion Stoica CS162 UCB Spring 2011 4 25 Lec 24 5 Ion Stoica CS162 UCB Spring 2011 Identifier to Node Mapping Example Consistent hashing Lec 24 6 Lookup lookup 37 Node 8 maps 5 8 Node 15 maps 9 15 Node 20 maps 16 20 Node 4 maps 59 4 4 58 8 15 Each node maintains a pointer to its successor 44 20 35 4 25 58 Route packet ID data to the node responsible for ID using successor pointers E g node 4 lookups for node responsible for ID 37 4 25 Lec 24 7 Page 2 8 node 44 is responsible for ID 37 15 44 20 35 32 Ion Stoica CS162 UCB Spring 2011 4 Each node maintains pointer to its successor 32 Ion Stoica CS162 UCB Spring 2011 Lec 24 8 Stabilization Procedure Joining Operation Periodic operation performed by each node n to maintain its successor when new nodes join the system n stabilize x succ pred if x n succ succ x if x better successor update succ notify n n tells successor about itself succ 4 pred 44 Node with id 50 joins the ring Node 50 needs to know at least one node already in the system 4 58 8 succ nil Assume known pred nil node is 15 50 n notify n if pred nil or n pred n pred n if n is better predecessor update 15 succ 58 pred 35 44 20 35 32 Ion Stoica CS162 UCB Spring 2011 4 25 Lec 24 9 Ion Stoica CS162 UCB Spring 2011 n 50 sends join 50 to node 15 n 44 returns node 58 n 50 updates its successor to 58 succ 58 succ nil pred nil succ 4 pred 44 4 58 8 n 50 executes stabilize n s successor 58 returns x 44 join 50 15 44 Ion Stoica CS162 UCB Spring 2011 n stabilize x succ pred if x n succ succ x succ notify n 32 Lec 24 11 Page 3 4 25 4 58 8 15 50 succ 58 pred 35 20 35 succ 4 pred 44 succ 58 pred nil 50 58 succ 58 pred 35 4 25 Joining Operation 44 Joining Operation Lec 24 10 x 4 25 44 20 35 Ion Stoica CS162 UCB Spring 2011 32 Lec 24 12 8 succ 58 pred 35 44 4 25 35 Ion Stoica CS162 UCB Spring 2011 Lec 24 13 4 25 succ 58 pred nil succ 58 pred 35 n notify n if pred nil or n pred n pred n 4 25 8 n 58 processes notify 50 pred 44 n 50 set pred 50 44 Ion Stoica CS162 UCB Spring 2011 32 Lec 24 14 succ 4 pred 44 pred 50 n notify n if pred nil or n pred n pred n 32 4 25 Lec 24 15 Page 4 4 58 8 15 50 succ 58 pred 35 20 35 35 succ 58 pred nil 15 50 20 Joining Operation 4 58 y 5 0 n 58 processes notify 50 pred 44 n 50 no tif 44 Ion Stoica CS162 UCB Spring 2011 Joining Operation succ 4 pred 44 15 n stabilize x succ pred if x n succ succ x succ notify n 32 8 50 succ 58 pred 35 20 n stabilize x succ pred if x n succ succ x succ notify n pred nil 15 50 4 58 succ 58 pred nil succ 4 pred 44 58 n 50 executes stabilize x 44 succ 58 n 50 sends to it s successor 58 notify 50 succ 58 no tif 4 y 5 0 n 50 executes stabilize x 44 succ 58 Joining Operation no tif succ 4 pred 44 y 5 0 Joining Operation 44 20 35 Ion Stoica CS162 UCB Spring 2011 32 Lec 24 16 Joining Operation succ 4 pred 50 n 44 runs stabilize n s successor 58 returns x 50 8 x 50 44 succ 4 pred 50 n 44 runs stabilize x 50 succ 58 35 Ion Stoica CS162 UCB Spring 2011 Lec 24 17 4 25 n 44 runs stabilize x 50 succ 58 n 44 sets succ 50 succ 58 pred nil succ 58 succ 50 pred 35 n stabilize x succ pred if x n succ succ x succ notify n 4 25 8 35 succ 58 pred nil Ion Stoica CS162 UCB Spring 2011 n stabilize x succ pred if x n succ succ x succ notify n 32 Lec 24 19 Page 5 4 25 4 8 15 50 succ 50 pred 35 20 35 Lec 24 18 58 notify 44 44 32 succ 4 pred 50 n 44 runs stabilize n 44 sends notify 44 to its successor 15 50 20 Joining Operation 4 58 44 Ion Stoica CS162 UCB Spring 2011 Joining Operation succ 4 pred 50 15 n stabilize x succ pred if x n succ succ x succ notify n 32 8 50 succ 58 pred 35 20 n stabilize x succ pred if x n succ succ x succ notify n 4 58 succ 58 pred nil 15 50 succ 58 pred 35 4 25 4 58 succ 58 pred nil Joining Operation 44 …


View Full Document

Berkeley COMPSCI 162 - Lecture 24 DHTs and Cloud Computing

Documents in this Course
Lecture 1

Lecture 1

12 pages

Nachos

Nachos

41 pages

Security

Security

39 pages

Load more
Loading Unlocking...
Login

Join to view Lecture 24 DHTs and Cloud Computing and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture 24 DHTs and Cloud Computing and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?