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

fear no more embrace eventual consistency
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Fear No More: Embrace Eventual Consistency

Sean Cribbs @seancribbs

slide-2
SLIDE 2

Distributed Systems Experts

slide-3
SLIDE 3
slide-4
SLIDE 4

FEAR

Photo from Wikimedia

slide-5
SLIDE 5

ACID vs. BASE

slide-6
SLIDE 6
  • Strong consistency
  • Isolation
  • Focus on “commit”
  • Nested transactions
  • Conservative

(pessimistic)

  • Weak consistency
  • Availability first
  • Best effort
  • Approximate answer
  • Aggressive

(optimistic)

ACID vs. BASE

Fox, Gribble, Chawathe, Brewer, Gauthier - Cluster-Based Scalable Network Services (SOSP97)

slide-7
SLIDE 7

ACID vs. BASE

“Inconsistency is the worst thing that could happen.” “Being unavailable is the worst thing that could happen.”

slide-8
SLIDE 8

Why BASE / EC?

slide-9
SLIDE 9

Why BASE / EC?

  • “Omniscience” is expensive and slow.
slide-10
SLIDE 10

Why BASE / EC?

  • “Omniscience” is expensive and slow.
  • Availability is often correlated to revenue.
slide-11
SLIDE 11

Why BASE / EC?

  • “Omniscience” is expensive and slow.
  • Availability is often correlated to revenue.
  • Failures happen all the time.
slide-12
SLIDE 12

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

slide-13
SLIDE 13

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.
slide-14
SLIDE 14

Safety & Liveness

Leslie Lamport 1977

slide-15
SLIDE 15

Safety

slide-16
SLIDE 16

Safety

  • “Bad things

don’t happen”

  • Point-in-time

identifiable

slide-17
SLIDE 17

Safety

  • “Bad things

don’t happen”

  • Point-in-time

identifiable

  • mutual

exclusion

  • partial

correctness

  • first-come,

first-serve

slide-18
SLIDE 18

Liveness

slide-19
SLIDE 19

Liveness

  • “Good things

eventually happen”

  • Always in

future

slide-20
SLIDE 20

Liveness

  • “Good things

eventually happen”

  • Always in

future

  • starvation

freedom

  • termination
  • guaranteed

service

slide-21
SLIDE 21
  • Strong consistency
  • Isolation
  • Focus on “commit”
  • Nested transactions
  • Conservative

(pessimistic)

  • Weak consistency
  • Availability first
  • Best effort
  • Approximate answer
  • Aggressive

(optimistic)

ACID vs. BASE

Fox, Gribble, Chawathe, Brewer, Gauthier - Cluster-Based Scalable Network Services (SOSP97)

slide-22
SLIDE 22

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/

Peter Bailis

slide-23
SLIDE 23

Liveness of BASE

  • Convergence - “eventual delivery”
  • Responsiveness - “eventual service”
  • Resilience - “eventual recovery”
  • Consensus-free - “eventual progress”
slide-24
SLIDE 24

Safety of BASE

  • Durability - “accepted writes are not lost”
  • Integrity - “data is not corrupted”
  • Authenticity - “data is not forged”
slide-25
SLIDE 25

Real BASE Systems

Photo from Wikimedia

slide-26
SLIDE 26

Domain Name Service

  • Federated, hierarchical database
  • How qconsf.com becomes 77.66.16.106
  • Layered system with caching
slide-27
SLIDE 27

Domain Name Service

  • Federated, hierarchical database
  • How qconsf.com becomes 77.66.16.106
  • Layered system with caching

Diagrams from Wikimedia

slide-28
SLIDE 28

Domain Name Service

  • Federated, hierarchical database
  • How qconsf.com becomes 77.66.16.106
  • Layered system with caching

Diagrams from Wikimedia

slide-29
SLIDE 29

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

slide-30
SLIDE 30

DNS Safety

  • Authenticity - forgery prevented by DNSSEC
slide-31
SLIDE 31

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

slide-32
SLIDE 32

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

slide-33
SLIDE 33

BitTorrent Safety

  • Integrity - each block is checksummed to

prevent corruption

slide-34
SLIDE 34

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)
slide-35
SLIDE 35

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

slide-36
SLIDE 36

Web: Safety

  • Privacy & Authenticity - HTTPS/SSL/TLS
  • Integrity - POST responses don’t pollute caches
slide-37
SLIDE 37

Dynamo

  • Key-value store: distributed,

replicated, partitioned

  • Client requests can go to any

node

  • Low-latency at high percentiles
  • Many clones: Riak, Cassandra,

Voldemort

1 2 3

slide-38
SLIDE 38

Dynamo: Liveness

  • Convergence - read-repair, hash-tree

exchanges, vector-clocks

  • Resilience - hinted-handoff, sloppy quorums
  • Responsiveness - replication
  • Consensus-free - loose coordination, concurrent

updates

slide-39
SLIDE 39

Dynamo: Safety

  • Authenticity - won’t serve data you didn’t store
  • Durability - confirmed writes are not lost
slide-40
SLIDE 40

ACID vs. BASE

slide-41
SLIDE 41

Photo by Associated Press

CONFLICT

slide-42
SLIDE 42

Photo by Associated Press

SPECTRUM

slide-43
SLIDE 43

Embrace Eventual Consistency

hugs!