Consistency in Distributed Systems Shane K Johnson CITYECH, Inc. March 31, 2010
Outline <ul><li>Physical Distribution
CAP Theorem </li><ul><li>BASE </li></ul><li>Consistency </li><ul><li>Eventual Consistency </li></ul><li>Consistent Hashing
Consensus Protocols
Vector Clocks </li></ul>
Physical Distribution <ul><li>Replicated
Partitioned
Both </li></ul>
CAP Theorem <ul><li>Brewer's Conjecture </li><ul><li>Eric Brewer
ACM Symposium on the Principles of Distributed Computing (PODC)
July 19th 2000 </li></ul><li>Brewer's Theorom </li><ul><li>Formally Proved by Seth Gilbert/Nancy Lynch
MIT
2002 </li></ul></ul>
CAP Theorem <ul><li>Consistent </li><ul><li>&quot;...the C in ACID...a preset contraint of distributed systems that multip...
Partition Tolerant </li></ul>
Upcoming SlideShare
Loading in...5
×

Consistency in Distributed Systems

3,947

Published on

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

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

No notes for slide

Consistency in Distributed Systems

  1. 1. Consistency in Distributed Systems Shane K Johnson CITYECH, Inc. March 31, 2010
  2. 2. Outline <ul><li>Physical Distribution
  3. 3. CAP Theorem </li><ul><li>BASE </li></ul><li>Consistency </li><ul><li>Eventual Consistency </li></ul><li>Consistent Hashing
  4. 4. Consensus Protocols
  5. 5. Vector Clocks </li></ul>
  6. 6. Physical Distribution <ul><li>Replicated
  7. 7. Partitioned
  8. 8. Both </li></ul>
  9. 9. CAP Theorem <ul><li>Brewer's Conjecture </li><ul><li>Eric Brewer
  10. 10. ACM Symposium on the Principles of Distributed Computing (PODC)
  11. 11. July 19th 2000 </li></ul><li>Brewer's Theorom </li><ul><li>Formally Proved by Seth Gilbert/Nancy Lynch
  12. 12. MIT
  13. 13. 2002 </li></ul></ul>
  14. 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. 15. Partition Tolerant </li></ul>
  16. 16. BASE <ul><li>Alternative to ACID </li><ul><li>Brewer
  17. 17. SOSP Article
  18. 18. 1997 </li></ul></ul>
  19. 19. BASE <ul><li>Basically
  20. 20. Available
  21. 21. Soft State
  22. 22. Eventually Consistent </li></ul>
  23. 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. 24. Eventually Consistent <ul><li>Werner Vogels – CTO, Amazon
  25. 25. Eventual Consistency </li><ul><li>Casual
  26. 26. Read Your Writes
  27. 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. 28. Eventually Consistent <ul><li>N = # Nodes
  29. 29. W = # Replicas to Acknowledge Update
  30. 30. R = # Replicas Contacted for Read
  31. 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. 32. Optimized Write W=1, R=N </li></ul>
  33. 33. Consistent Hashing <ul><li>Before </li><ul><li>Object o
  34. 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. 35. Consistent Hashing <ul><li>Hash Nodes
  36. 36. Treat Hash Table as Hash Ring
  37. 37. Hash Object
  38. 38. Traverse Until Node Found </li></ul>
  39. 39. Consensus Protocols <ul><li>Quorum
  40. 40. Paxos </li><ul><li>Leslie Lamport </li><ul><li>The Part-Time Parliament, 1998 </li></ul><li>Roles </li><ul><li>Client
  41. 41. Acceptor
  42. 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. 43. Vector Clocks <ul><li>Lamport Timestamps -> Logical Clocks </li></ul>
  44. 44. References <ul><li>http://www.julianbrowne.com/article/viewer/brewers-cap-theorem
  45. 45. http://www.allthingsdistributed.com/2008/12/eventually_consistent.html
  46. 46. http://weblogs.java.net/blog/tomwhite/archive/2007/11/consistent_hash.html
  47. 47. http://en.wikipedia.org/wiki/Paxos_algorithm
  48. 48. http://en.wikipedia.org/wiki/Vector_clock </li></ul>
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×