Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CAPtain Obvious

CAPtain Obvious

Kinda old presentation I did on CAP, Vector Clocks and CRDTs

Yann Schwartz

November 28, 2013
Tweet

More Decks by Yann Schwartz

Other Decks in Programming

Transcript

  1. Wait… • Things don’t fit on disk • Things don’t

    fit in memory • Things are CPU/IO bound • My server goes down
  2. Problem solved! • I’ll use : • master / slave

    • sharding • masterless nodes • an infinite number of nodes!
  3. Wait… • Distributed systems fallacies • network is reliable •

    latency is zero • bandwidth is infinite • network is secure • topology doesn't change... • there is one administrator • transport cost is zero • network is homogenous
  4. Ok, I choose C • Nice, predictable • Need synchronisation

    and consensus • Linearizability - total order of operations
  5. Killjoy - the sequel • "Anything which needs agreement 


    will eventually fail at scale" 
 
 - Werner Vogels
  6. OK, A then? • I can always read (staleness) •

    I can always write (conflicts)
  7. Dynamo-like • No master • Consistent hashing • Replication •

    Eventually consistent • Quorum (R, W, DW, etc.)
  8. The problem of time • It’s possible to reason on

    event timestamps if • there’s a total order of timestamps • Timestamps are unique • if t2 > t1 then t2 happened AFTER t1
  9. The problem of time • “Time, clocks and the ordering

    of events in a Distributed System”, Leslie Lamport 1978
  10. Definition • An ordered set is a Join Semi-lattice iff

    for all x,y E S, LUB(x,y) exits
 • (LUB = Least Upper Bound function) • An object taking its values from a JSL and where merge(x,y)= LUB(x,y) converges towards the LUB