Your SlideShare is downloading. ×
0
Consistency in Distributed Systems
Consistency in Distributed Systems
Consistency in Distributed Systems
Consistency in Distributed Systems
Consistency in Distributed Systems
Consistency in Distributed Systems
Consistency in Distributed Systems
Consistency in Distributed Systems
Consistency in Distributed Systems
Consistency in Distributed Systems
Consistency in Distributed Systems
Consistency in Distributed Systems
Consistency in Distributed Systems
Consistency in Distributed Systems
Consistency in Distributed Systems
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Consistency in Distributed Systems

3,900

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
3,900
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
78
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  1. Consistency in Distributed Systems Shane K Johnson CITYECH, Inc. March 31, 2010
  2. Outline <ul><li>Physical Distribution
  3. CAP Theorem </li><ul><li>BASE </li></ul><li>Consistency </li><ul><li>Eventual Consistency </li></ul><li>Consistent Hashing
  4. Consensus Protocols
  5. Vector Clocks </li></ul>
  6. Physical Distribution <ul><li>Replicated
  7. Partitioned
  8. Both </li></ul>
  9. CAP Theorem <ul><li>Brewer's Conjecture </li><ul><li>Eric Brewer
  10. ACM Symposium on the Principles of Distributed Computing (PODC)
  11. July 19th 2000 </li></ul><li>Brewer's Theorom </li><ul><li>Formally Proved by Seth Gilbert/Nancy Lynch
  12. MIT
  13. 2002 </li></ul></ul>
  14. CAP Theorem <ul><li>Consistent </li><ul><li>&quot;...the C in ACID...a preset contraint of distributed systems that multiple values for the same piece of data are not allowed...&quot; </li></ul><li>Available
  15. Partition Tolerant </li></ul>
  16. BASE <ul><li>Alternative to ACID </li><ul><li>Brewer
  17. SOSP Article
  18. 1997 </li></ul></ul>
  19. BASE <ul><li>Basically
  20. Available
  21. Soft State
  22. Eventually Consistent </li></ul>
  23. Consistency <ul><li>Strong </li><ul><li>“After the update completes, any subsequent access will return the updated value.” </li></ul><li>Weak </li><ul><li>“The system does not guarantee that subsequent accesses will return the updated value.” Inconsistency Windows </li></ul><li>Eventual </li><ul><li>“The storage system guarantees that if no new updates are made to the object, eventually all accesses will return the last updated value.” </li></ul></ul>
  24. Eventually Consistent <ul><li>Werner Vogels – CTO, Amazon
  25. Eventual Consistency </li><ul><li>Casual
  26. Read Your Writes
  27. Session </li><ul><li>Session Based Read Your Writes </li></ul><li>Monotonic Read </li><ul><li>Once a process has seen a particular value, it will never see an older one. </li></ul><li>Monotonic Write </li><ul><li>Writes by the same process are serialized. </li></ul></ul></ul>
  28. Eventually Consistent <ul><li>N = # Nodes
  29. W = # Replicas to Acknowledge Update
  30. R = # Replicas Contacted for Read
  31. Strong (W + R > N) </li><ul><li>Synchronous Master/Master N=2, W=2, R=1 </li></ul><li>Weak/Eventual (W + R <= N) </li><ul><li>Asynchronous Master/Master N=2, W=1, R=1 </li></ul><li>Optimized Read R=1, N=W
  32. Optimized Write W=1, R=N </li></ul>
  33. Consistent Hashing <ul><li>Before </li><ul><li>Object o
  34. # Nodes n </li><ul><li>hash(o) mod n </li></ul></ul><li>Problem </li><ul><li>Rebalancing (Add/Remove Nodes) </li></ul></ul>
  35. Consistent Hashing <ul><li>Hash Nodes
  36. Treat Hash Table as Hash Ring
  37. Hash Object
  38. Traverse Until Node Found </li></ul>
  39. Consensus Protocols <ul><li>Quorum
  40. Paxos </li><ul><li>Leslie Lamport </li><ul><li>The Part-Time Parliament, 1998 </li></ul><li>Roles </li><ul><li>Client
  41. Acceptor
  42. Proposer </li><ul><li>Notified Quorum of Acceptors on Behalf of Client </li></ul><li>Learner </li><ul><li>Execute Request, Send Response to Client </li></ul></ul></ul></ul>
  43. Vector Clocks <ul><li>Lamport Timestamps -> Logical Clocks </li></ul>
  44. References <ul><li>http://www.julianbrowne.com/article/viewer/brewers-cap-theorem
  45. http://www.allthingsdistributed.com/2008/12/eventually_consistent.html
  46. http://weblogs.java.net/blog/tomwhite/archive/2007/11/consistent_hash.html
  47. http://en.wikipedia.org/wiki/Paxos_algorithm
  48. http://en.wikipedia.org/wiki/Vector_clock </li></ul>

×