fear no more embrace eventual consistency
play

Fear No More: Embrace Eventual Consistency Sean Cribbs - PowerPoint PPT Presentation

Fear No More: Embrace Eventual Consistency Sean Cribbs @seancribbs Distributed Systems Experts FEAR Photo from Wikimedia ACID vs. BASE ACID vs. BASE Strong consistency Weak consistency Isolation Availability first Focus


  1. Fear No More: Embrace Eventual Consistency Sean Cribbs @seancribbs

  2. Distributed Systems Experts

  3. FEAR Photo from Wikimedia

  4. ACID vs. BASE

  5. ACID vs. BASE • Strong consistency • Weak consistency • Isolation • Availability first • Focus on “commit” • Best effort • Nested transactions • Approximate answer • Conservative • Aggressive (pessimistic) (optimistic) Fox, Gribble, Chawathe, Brewer, Gauthier - Cluster-Based Scalable Network Services (SOSP97)

  6. ACID vs. BASE “Inconsistency is “Being unavailable the worst thing that is the worst thing could happen.” that could happen.”

  7. Why BASE / EC?

  8. Why BASE / EC? • “Omniscience” is expensive and slow .

  9. Why BASE / EC? • “Omniscience” is expensive and slow . • Availability is often correlated to revenue .

  10. Why BASE / EC? • “Omniscience” is expensive and slow . • Availability is often correlated to revenue . • Failures happen all the time .

  11. Why BASE / EC? • “Omniscience” is expensive and slow . • Availability is often correlated to revenue . • Failures happen all the time . “Any sufficiently large system is in a constant state of partial failure.” Justin Sheehy, Basho CTO

  12. Why BASE / EC? • “Omniscience” is expensive and slow . • Availability is often correlated to revenue . • Failures happen all the time . • You’re probably doing it already .

  13. Safety & Liveness Leslie Lamport 1977

  14. Safety

  15. Safety • “Bad things don’t happen” • Point-in-time identifiable

  16. Safety • “Bad things • mutual don’t happen” exclusion • Point-in-time • partial identifiable correctness • first-come, first-serve

  17. Liveness

  18. Liveness • “Good things eventually happen” • Always in future

  19. Liveness • “Good things • starvation eventually freedom happen” • termination • Always in • guaranteed future service

  20. ACID vs. BASE • Strong consistency • Weak consistency • Isolation • Availability first • Focus on “commit” • Best effort • Nested transactions • Approximate answer • Conservative • Aggressive (pessimistic) (optimistic) Fox, Gribble, Chawathe, Brewer, Gauthier - Cluster-Based Scalable Network Services (SOSP97)

  21. Peter Bailis Eventual consistency is not safe “...it’s easy to satisfy liveness without being useful ... If all replicas return the value 42 in response to every request, the system is eventually consistent. ” http://www.bailis.org/blog/safety-and-liveness-eventual-consistency-is-not-safe/

  22. Liveness of BASE • Convergence - “eventual delivery” • Responsiveness - “eventual service” • Resilience - “eventual recovery” • Consensus-free - “eventual progress”

  23. Safety of BASE • Durability - “accepted writes are not lost” • Integrity - “data is not corrupted” • Authenticity - “data is not forged”

  24. Real BASE Systems Photo from Wikimedia

  25. Domain Name Service • Federated, hierarchical database • How qconsf.com becomes 77.66.16.106 • Layered system with caching

  26. Domain Name Service • Federated, hierarchical database • How qconsf.com becomes 77.66.16.106 • Layered system with caching Diagrams from Wikimedia

  27. Domain Name Service • Federated, hierarchical database • How qconsf.com becomes 77.66.16.106 • Layered system with caching Diagrams from Wikimedia

  28. DNS Liveness • Convergence - caches eventually expire • Consensus-free - local authority over subtree updates • Responsiveness - intermediaries can cache results and reply quicker • Resilience - authority servers can be replicated/ load-balanced

  29. DNS Safety • Authenticity - forgery prevented by DNSSEC

  30. BitTorrent • Peer-to-peer cooperative large-file transfer • Dynamic membership and block discovery through the “tracker” node • Epidemic effect http://computer.howstuffworks.com/bittorrent2.htm

  31. BitTorrent Liveness • Convergence - all peers that remain connected eventually become seeds • Resilience - loss of one peer doesn’t impede progress • Responsiveness - closer, faster peers tend to be preferred

  32. BitTorrent Safety • Integrity - each block is checksummed to prevent corruption

  33. The Web • Sparsely-connected graph of hypertext documents identified by URIs • Rich caching semantics: expiration, validation, control • Fluid evolution through uniform interface • Layered system (federated)

  34. Web: Liveness • Consensus-free - local documents can be changed, moved, removed without coordination • Convergence - caching semantics prevent unbounded staleness, redirection • Responsiveness - many parties can proxy, cache • Resilience - failure of one server doesn’t stop the system

  35. Web: Safety • Privacy & Authenticity - HTTPS/SSL/TLS • Integrity - POST responses don’t pollute caches

  36. Dynamo 1 • Key-value store: distributed, replicated, partitioned 2 • Client requests can go to any node 3 • Low-latency at high percentiles • Many clones: Riak, Cassandra, Voldemort

  37. Dynamo: Liveness • Convergence - read-repair, hash-tree exchanges, vector-clocks • Resilience - hinted-handoff, sloppy quorums • Responsiveness - replication • Consensus-free - loose coordination, concurrent updates

  38. Dynamo: Safety • Authenticity - won’t serve data you didn’t store • Durability - confirmed writes are not lost

  39. ACID vs. BASE

  40. CONFLICT Photo by Associated Press

  41. SPECTRUM Photo by Associated Press

  42. hugs! Embrace Eventual Consistency

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend