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

Papers We Love: Managing Update Conflicts in Bayou

pbailis
December 17, 2014

Papers We Love: Managing Update Conflicts in Bayou

pbailis

December 17, 2014
Tweet

More Decks by pbailis

Other Decks in Technology

Transcript

  1. Papers We Love SF:
    Bayou
    Peter Bailis @pbailis
    UC Berkeley
    17 December 2014

    View Slide

  2. Who am I?
    Ph.D. candidate, 4th year student at Berkeley
    Study high performance distributed databases
    » When do we need coordination?
    » What happens if we don’t coordinate?
    Graduating 2015!
    http://bailis.org/

    View Slide

  3. View Slide

  4. Why Bayou?
    “NoSQL” before “NoSQL”
    Learn from our predecessors
    Rethink application, system boundaries
    Lucid discussion of systems challenges

    View Slide

  5. Talk Outline
    Background and system architecture
    Conflict detection and resolution APIs
    “Correctness” and ordering
    Lessons for all of us

    View Slide

  6. Talk Outline
    Background and system architecture
    Conflict detection and resolution APIs
    “Correctness” and ordering
    Lessons for all of us

    View Slide

  7. View Slide

  8. Bayou Goals
    Storage system for mobile devices:

    View Slide

  9. Bayou Goals
    Storage system for mobile devices:
    Handle frequent disconnections

    View Slide

  10. View Slide

  11. View Slide

  12. View Slide

  13. Bayou Goals
    Storage system for mobile devices:
    Handle frequent disconnections

    View Slide

  14. Bayou Goals
    Storage system for mobile devices:
    Handle frequent disconnections
    Reason about distribution explicitly

    View Slide

  15. View Slide

  16. Bayou Goals
    Storage system for mobile devices:
    Handle frequent disconnections
    Reason about distribution explicitly

    View Slide

  17. Bayou Goals
    Storage system for mobile devices:
    Handle frequent disconnections
    Reason about distribution explicitly
    Facilitate conflict detection and resolution

    View Slide

  18. How do we build a system
    that allows update-
    anywhere but allows users
    to easily build correct
    applications?

    View Slide

  19. View Slide

  20. Basic Architecture

    View Slide

  21. Basic Architecture
    Optimistically replicated
    distributed database

    View Slide

  22. View Slide

  23. Basic Architecture
    Optimistically replicated
    distributed database
    Update-anywhere; CAP “AP”
    » Guarantees availability
    » Low latency and scalability!
    Use anti-entropy to exchange
    updates
    » Pick your favorite

    View Slide

  24. View Slide

  25. Talk Outline
    Background and system architecture
    Conflict detection and resolution APIs
    “Correctness” and ordering
    Lessons for all of us

    View Slide

  26. Talk Outline
    Background and system architecture
    Conflict detection and resolution APIs
    “Correctness” and ordering
    Lessons for all of us

    View Slide

  27. Main problem: “conflicts”
    What happens if two clients simultaneously update the
    same piece of data?

    View Slide

  28. Example:
    Peter wants to book Fastly HQ on 12/17 at 7PM
    Ines wants to book Fastly HQ on 12/17 at 7PM

    View Slide

  29. Example:
    Peter wants to book Fastly HQ on 12/17 at 7PM
    Ines wants to book Fastly HQ on 12/17 at 7PM
    Peter and Ines are connected to different servers

    View Slide

  30. Example:
    Peter wants to book Fastly HQ on 12/17 at 7PM
    Ines wants to book Fastly HQ on 12/17 at 7PM
    Peter and Ines are connected to different servers
    What will happen?

    View Slide

  31. Example:
    Peter wants to book Fastly HQ on 12/17 at 7PM
    Ines wants to book Fastly HQ on 12/17 at 7PM
    Peter and Ines are connected to different servers
    What will happen?
    Example:

    View Slide

  32. Example:
    Peter wants to book Fastly HQ on 12/17 at 7PM
    Ines wants to book Fastly HQ on 12/17 at 7PM
    Peter and Ines are connected to different servers
    What will happen?
    Example:
    Mike wants to give Peter $100
    Carol wants to give Peter $100

    View Slide

  33. Example:
    Peter wants to book Fastly HQ on 12/17 at 7PM
    Ines wants to book Fastly HQ on 12/17 at 7PM
    Peter and Ines are connected to different servers
    What will happen?
    Example:
    Mike wants to give Peter $100
    Carol wants to give Peter $100
    Mike and Carol are connected to different servers

    View Slide

  34. Example:
    Peter wants to book Fastly HQ on 12/17 at 7PM
    Ines wants to book Fastly HQ on 12/17 at 7PM
    Peter and Ines are connected to different servers
    What will happen?
    Example:
    Mike wants to give Peter $100
    Carol wants to give Peter $100
    Mike and Carol are connected to different servers
    What will happen?

    View Slide

  35. Main problem: “conflicts”
    What happens if two clients simultaneously update the
    same piece of data?

    View Slide

  36. Main problem: “conflicts”
    It depends on the application!
    What happens if two clients simultaneously update the
    same piece of data?

    View Slide

  37. Main problem: “conflicts”
    It depends on the application!
    Traditional DB (“serializability”): always* matters!
    What happens if two clients simultaneously update the
    same piece of data?

    View Slide

  38. Main problem: “conflicts”
    It depends on the application!
    Traditional DB (“serializability”): always* matters!
    Bayou: let the application help us out!
    What happens if two clients simultaneously update the
    same piece of data?

    View Slide

  39. Main problem: “conflicts”
    Bayou writes have three components:

    View Slide

  40. Main problem: “conflicts”
    Bayou writes have three components:
    » An update function: the actual write

    View Slide

  41. Main problem: “conflicts”
    Bayou writes have three components:
    » An update function: the actual write
    » A dependency check: conflict detection

    View Slide

  42. Main problem: “conflicts”
    Bayou writes have three components:
    » An update function: the actual write
    » A dependency check: conflict detection
    » A merge function: conflict compensation

    View Slide

  43. Main problem: “conflicts”
    Bayou writes have three components:
    » An update function: the actual write
    » A dependency check: conflict detection
    » A merge function: conflict compensation
    If dependency check passes:
    apply update function
    Else:
    apply merge function

    View Slide

  44. Example:
    Booking tonight’s meetup:

    View Slide

  45. Example:
    Booking tonight’s meetup:
    » Update function: insert 12/17/14, “Fastly HQ”, Ines

    View Slide

  46. Example:
    Booking tonight’s meetup:
    » Update function: insert 12/17/14, “Fastly HQ”, Ines
    » Dependency check: Is the requested time and location
    available?

    View Slide

  47. Example:
    Booking tonight’s meetup:
    » Update function: insert 12/17/14, “Fastly HQ”, Ines
    » Dependency check: Is the requested time and location
    available?
    » Merge function: try to find another time based on
    provided alternates

    View Slide

  48. View Slide

  49. View Slide

  50. View Slide

  51. View Slide

  52. Inside the server:
    Date Location User Time
    12/16 Fastly HQ Fred 2:30-5PM
    12/18 Fastly HQ Artur 10AM-12PM
    12/17 FastlyHQ Inez 6:30-9PM

    View Slide

  53. Inside the server:
    Date Location User Time
    12/16 Fastly HQ Fred 2:30-5PM
    12/18 Fastly HQ Artur 10AM-12PM
    12/17 FastlyHQ Inez 6:30-9PM

    View Slide

  54. Inside the server:
    Date Location User Time
    12/16 Fastly HQ Fred 2:30-5PM
    12/18 Fastly HQ Artur 10AM-12PM
    12/17 FastlyHQ Inez 6:30-9PM
    Update function: insert 12/17/14, “Fastly HQ”, Ines

    View Slide

  55. Inside the server:
    Date Location User Time
    12/16 Fastly HQ Fred 2:30-5PM
    12/18 Fastly HQ Artur 10AM-12PM
    12/17 FastlyHQ Inez 6:30-9PM
    Update function: insert 12/17/14, “Fastly HQ”, Ines
    Dependency check: Is the requested time and location
    available?

    View Slide

  56. Inside the server:
    Date Location User Time
    12/16 Fastly HQ Fred 2:30-5PM
    12/18 Fastly HQ Artur 10AM-12PM
    12/17 FastlyHQ Inez 6:30-9PM
    Update function: insert 12/17/14, “Fastly HQ”, Ines
    Dependency check: Is the requested time and location
    available?

    View Slide

  57. View Slide

  58. View Slide

  59. View Slide

  60. View Slide

  61. View Slide

  62. View Slide

  63. View Slide

  64. View Slide

  65. View Slide

  66. Another example:
    Money transfer:

    View Slide

  67. Another example:
    Money transfer:
    » Update function: transfer $100 from Jan to Mary

    View Slide

  68. Another example:
    Money transfer:
    » Update function: transfer $100 from Jan to Mary
    » Dependency check: does Jan have $100 in her account?

    View Slide

  69. Another example:
    Money transfer:
    » Update function: transfer $100 from Jan to Mary
    » Dependency check: does Jan have $100 in her account?
    » Merge function: log an error

    View Slide

  70. User Balance
    Jan $110
    Marsha $10
    Peter $42
    » Update function: transfer $100 from Jan to Marsha
    » Dependency check: does Jan have $100 in her account?
    » Merge function: log an error
    Errors

    View Slide

  71. » Update function: transfer $100 from Jan to Marsha
    » Dependency check: does Jan have $100 in her account?
    » Merge function: log an error
    » Update function: transfer $100 from Jan to Peter
    » Dependency check: does Jan have $100 in her account?
    » Merge function: log an error
    User Balance
    Jan $10
    Marsha $110
    Peter $42
    Errors

    View Slide

  72. » Update function: transfer $100 from Jan to Marsha
    » Dependency check: does Jan have $100 in her account?
    » Merge function: log an error
    » Update function: transfer $100 from Jan to Peter
    » Dependency check: does Jan have $100 in her account?
    » Merge function: log an error
    Errors
    Jan->Peter failed!
    User Balance
    Jan $10
    Marsha $110
    Peter $42

    View Slide

  73. View Slide

  74. View Slide

  75. View Slide

  76. View Slide

  77. View Slide

  78. View Slide

  79. View Slide

  80. View Slide

  81. View Slide

  82. View Slide

  83. View Slide

  84. View Slide

  85. View Slide

  86. Write stability
    How do we ensure that all servers eventually agree?

    View Slide

  87. Write stability
    How do we ensure that all servers eventually agree?
    Decide on a “stable” prefix of writes:

    View Slide

  88. Write stability
    How do we ensure that all servers eventually agree?
    Decide on a “stable” prefix of writes:
    » Strawman: order writes by timestamp

    View Slide

  89. Write stability
    How do we ensure that all servers eventually agree?
    Decide on a “stable” prefix of writes:
    » Strawman: order writes by timestamp
    • Drawbacks?

    View Slide

  90. » Update function: transfer $100 from Jan to Marsha
    » Dependency check: does Jan have $100 in her account?
    » Merge function: log an error
    User Balance
    Jan $10
    Marsha $110
    Peter $42
    Errors
    Timestamp 10

    View Slide

  91. » Update function: transfer $100 from Jan to Marsha
    » Dependency check: does Jan have $100 in her account?
    » Merge function: log an error
    » Update function: transfer $100 from Jan to Peter
    » Dependency check: does Jan have $100 in her account?
    » Merge function: log an error
    User Balance
    Jan $10
    Marsha $110
    Peter $42
    Errors
    Timestamp 10

    View Slide

  92. » Update function: transfer $100 from Jan to Marsha
    » Dependency check: does Jan have $100 in her account?
    » Merge function: log an error
    » Update function: transfer $100 from Jan to Peter
    » Dependency check: does Jan have $100 in her account?
    » Merge function: log an error
    User Balance
    Jan $10
    Marsha $110
    Peter $42
    Errors
    Timestamp 10
    Timestamp 2

    View Slide

  93. User Balance
    Jan $110
    Marsha $10
    Peter $42
    Errors

    View Slide

  94. User Balance
    Jan $110
    Marsha $10
    Peter $42
    Errors
    » Update function: transfer $100 from Jan to Peter
    » Dependency check: does Jan have $100 in her account?
    » Merge function: log an error
    Timestamp 2

    View Slide

  95. User Balance
    Jan $10
    Marsha $10
    Peter $142
    » Update function: transfer $100 from Jan to Peter
    » Dependency check: does Jan have $100 in her account?
    » Merge function: log an error
    Timestamp 2
    Errors
    Jan->Marsha failed!

    View Slide

  96. User Balance
    Jan $10
    Marsha $10
    Peter $142
    » Update function: transfer $100 from Jan to Peter
    » Dependency check: does Jan have $100 in her account?
    » Merge function: log an error
    Timestamp 2
    » Update function: transfer $100 from Jan to Marsha
    » Dependency check: does Jan have $100 in her account?
    » Merge function: log an error
    Timestamp 10
    Errors
    Jan->Marsha failed!

    View Slide

  97. 11

    View Slide

  98. 11 22

    View Slide

  99. 11 22 28

    View Slide

  100. 11 22 28 34

    View Slide

  101. 11 22 28 34
    13

    View Slide

  102. 11 22 28 34
    13

    View Slide

  103. 11 22 28 34
    13

    View Slide

  104. 11 22 28 34
    13
    NEED TO RE-EXECUTE!

    View Slide

  105. 11 22 28 34
    13
    NEED TO RE-EXECUTE!
    Also, makes GC hard

    View Slide

  106. Write stability
    How do we ensure that all servers eventually agree?
    Decide on a “stable” prefix of writes:
    » Strawman: order writes by timestamp
    » Bayou: uses master to determine ordering

    View Slide

  107. MASTER

    View Slide

  108. MASTER

    View Slide

  109. MASTER
    TENTATIVE COMMITTED
    T C
    T C T C

    View Slide

  110. MASTER
    TENTATIVE COMMITTED
    T C
    T C T C

    View Slide

  111. MASTER
    TENTATIVE COMMITTED
    T C
    T C T C

    View Slide

  112. MASTER
    TENTATIVE COMMITTED
    T C
    T C T C

    View Slide

  113. MASTER
    TENTATIVE COMMITTED
    T C
    T C T C

    View Slide

  114. MASTER
    TENTATIVE COMMITTED
    T C
    T C T C

    View Slide

  115. MASTER
    TENTATIVE COMMITTED
    T C
    T C T C

    View Slide

  116. MASTER
    TENTATIVE COMMITTED
    T C
    T C T C

    View Slide

  117. MASTER
    TENTATIVE COMMITTED
    T C
    T C T C

    View Slide

  118. MASTER
    TENTATIVE COMMITTED
    T C
    T C T C

    View Slide

  119. MASTER
    TENTATIVE COMMITTED
    T C
    T C T C

    View Slide

  120. MASTER
    TENTATIVE COMMITTED
    T C
    T C T C

    View Slide

  121. MASTER
    TENTATIVE COMMITTED
    T C
    T C T C

    View Slide

  122. Write stability
    How do we ensure that all servers eventually agree?
    Decide on a “stable” prefix of writes:
    » Strawman: order writes by timestamp
    • Drawbacks?
    » Bayou: uses master to determine ordering
    • Benefits?
    Note: don’t require commutative updates!

    View Slide

  123. Read API
    Can read from:
    » Stable storage: only committed writes
    » Tentative storage: all writes seen so far

    View Slide

  124. Read API
    Can read from:
    » Stable storage: only committed writes
    » Tentative storage: all writes seen so far
    Why read from tentative storage at all?

    View Slide

  125. View Slide

  126. View Slide

  127. Talk Outline
    Background and system architecture
    Conflict detection and resolution APIs
    “Correctness” and ordering
    Lessons for all of us

    View Slide

  128. Talk Outline
    Background and system architecture
    Conflict detection and resolution APIs
    “Correctness” and ordering
    Lessons for all of us

    View Slide

  129. Bayou’s Secret Sauce
    Push app logic into updates:

    View Slide

  130. Bayou’s Secret Sauce
    Push app logic into updates:
    » Read and write are insufficiently expressive!

    View Slide

  131. » Update function: transfer $100 from Jan to Peter
    » Dependency check: does Jan have $100 in her account?
    » Merge function: log an error
    » Update function: transfer $100 from Jan to Mary
    » Dependency check: does Jan have $100 in her account?
    » Merge function: log an error

    View Slide

  132. » Update function: transfer $100 from Jan to Peter
    » Dependency check: does Jan have $100 in her account?
    » Merge function: log an error
    » Update function: transfer $100 from Jan to Mary
    » Dependency check: does Jan have $100 in her account?
    » Merge function: log an error
    WRITE: Jan = 10; Peter = 42
    WRITE: Jan = 10; Mary = 110

    View Slide

  133. » Update function: transfer $100 from Jan to Peter
    » Dependency check: does Jan have $100 in her account?
    » Merge function: log an error
    » Update function: transfer $100 from Jan to Mary
    » Dependency check: does Jan have $100 in her account?
    » Merge function: log an error
    WRITE: Jan = 10; Peter = 42
    WRITE: Jan = 10; Mary = 110
    » decrement Jan by $100; increment Peter by 100
    » decrement Jan by $100; increment Mary by 100

    View Slide

  134. Bayou’s Secret Sauce
    Push app logic into updates:
    » Read and write are insufficiently expressive!

    View Slide

  135. Bayou’s Secret Sauce
    Push app logic into updates:
    » Read and write are insufficiently expressive!
    Capture transaction intent:

    View Slide

  136. Bayou’s Secret Sauce
    Push app logic into updates:
    » Read and write are insufficiently expressive!
    Capture transaction intent:
    » Dependency checks encode preconditions
    » e.g., guarded atomic actions

    View Slide

  137. What does Bayou guarantee?
    Eventually all updates are applied in the same
    order on all servers

    View Slide

  138. What does Bayou guarantee?
    Eventually all updates are applied in the same
    order on all servers
    » Kind of like serializable/ACID transactions!

    View Slide

  139. What does Bayou guarantee?
    Eventually all updates are applied in the same
    order on all servers
    » Kind of like serializable/ACID transactions!
    » Dependency checks enforce invariants

    View Slide

  140. What does Bayou guarantee?
    Eventually all updates are applied in the same
    order on all servers
    » Kind of like serializable/ACID transactions!
    » Dependency checks enforce invariants
    » Did we just “beat CAP”?

    View Slide

  141. What does Bayou guarantee?
    Eventually all updates are applied in the same
    order on all servers
    » Kind of like serializable/ACID transactions!
    » Dependency checks enforce invariants
    » Did we just “beat CAP”?
    Key: eventually means we have to wait

    View Slide

  142. H-Store, VoltDB, Granola,
    Calvin, Atomic Broadcast
    Idea sketch: pre-schedule transactions, then
    execute them sequentially on respective servers

    View Slide

  143. H-Store, VoltDB, Granola,
    Calvin, Atomic Broadcast
    Idea sketch: pre-schedule transactions, then
    execute them sequentially on respective servers
    Totally ordered outcomes on each replica

    View Slide

  144. H-Store, VoltDB, Granola,
    Calvin, Atomic Broadcast
    Idea sketch: pre-schedule transactions, then
    execute them sequentially on respective servers
    Totally ordered outcomes on each replica
    …but ordering determined up front!

    View Slide

  145. View Slide

  146. Bayou 㱺 “ACID”

    View Slide

  147. Bayou 㱺 “ACID”
    1.) Given transaction T, issue write W:

    View Slide

  148. Bayou 㱺 “ACID”
    1.) Given transaction T, issue write W:
    » Update function: // do nothing

    View Slide

  149. Bayou 㱺 “ACID”
    1.) Given transaction T, issue write W:
    » Update function: // do nothing
    » Dependency check: false

    View Slide

  150. Bayou 㱺 “ACID”
    1.) Given transaction T, issue write W:
    » Update function: // do nothing
    » Dependency check: false
    » Merge function: execute T

    View Slide

  151. Bayou 㱺 “ACID”
    1.) Given transaction T, issue write W:
    » Update function: // do nothing
    » Dependency check: false
    » Merge function: execute T
    2.) Wait for write W to commit.

    View Slide

  152. Bayou 㱺 “ACID”
    1.) Given transaction T, issue write W:
    » Update function: // do nothing
    » Dependency check: false
    » Merge function: execute T
    2.) Wait for write W to commit.
    3.) Notify success.

    View Slide

  153. View Slide

  154. What does Bayou guarantee?
    Eventually all writes are applied in the same order
    on all servers
    » Kind of like serializable/ACID transactions!
    » Dependency checks enforce invariants
    » Did we just “beat CAP”?
    Key: eventually means we have to wait

    View Slide

  155. “#is meeting room scheduling program is
    intended for use after a group of people have
    already decided that they want to meet in a
    certain room and have determined a set of
    acceptable times for the meeting. It does not
    help them to determine a mutually agreeable
    place and time for the meeting, it only allows
    them to reserve the room.”

    View Slide

  156. “#is meeting room scheduling program is
    intended for use after a group of people have
    already decided that they want to meet in a
    certain room and have determined a set of
    acceptable times for the meeting. It does not
    help them to determine a mutually agreeable
    place and time for the meeting, it only allows
    them to reserve the room.”

    View Slide

  157. “#is meeting room scheduling program is
    intended for use after a group of people have
    already decided that they want to meet in a
    certain room and have determined a set of
    acceptable times for the meeting. It does not
    help them to determine a mutually agreeable
    place and time for the meeting, it only allows
    them to reserve the room.”

    View Slide

  158. When can we avoid “waiting”?

    View Slide

  159. When can we avoid “waiting”?
    Commutative logic need not be re-executed in the
    log! (Paper discusses this.)

    View Slide

  160. A note on commutativity
    Commutative logic: decisions made in application
    logic are insensitive to ordering

    View Slide

  161. A note on commutativity
    Commutative logic: decisions made in application
    logic are insensitive to ordering
    Commutative datatypes: operations on datatypes are
    insensitive to ordering
    #e latter are useful, but won’t ensure correctness!
    http://www.bailis.org/blog/data-integrity-and-problems-of-scope/

    View Slide

  162. » Update function: transfer $100 from Jan to Peter
    » Dependency check: does Jan have $100 in her account?
    » Merge function: log an error
    » Update function: transfer $100 from Jan to Marsha
    » Dependency check: does Jan have $100 in her account?
    » Merge function: log an error
    » decrement Jan by $100; increment Peter by 100
    » decrement Jan by $100; increment Marsha by 100
    WRITE: Jan = 10; Peter = 42
    WRITE: Jan = 10; Marsha = 110

    View Slide

  163. A note on commutativity
    Commutative logic: decisions made in application
    logic are insensitive to ordering
    Commutative datatypes: operations on datatypes are
    insensitive to ordering
    #e latter are useful, but won’t ensure correctness!
    http://www.bailis.org/blog/data-integrity-and-problems-of-scope/

    View Slide

  164. When can we avoid “waiting”?
    Commutative logic need not be re-executed in the
    log! (Paper discusses this.)

    View Slide

  165. When can we avoid “waiting”?
    CALM !eorem: monotonic logic <=> determinism
    despite different orders [CIDR 2011] See also Kuper’s LVars
    Commutative logic need not be re-executed in the
    log! (Paper discusses this.)

    View Slide

  166. When can we avoid “waiting”?
    CALM !eorem: monotonic logic <=> determinism
    despite different orders [CIDR 2011] See also Kuper’s LVars
    I-confluence: guarantees “safe” tentative reads with
    convergent and safe outcomes [VLDB 2015]
    Commutative logic need not be re-executed in the
    log! (Paper discusses this.)

    View Slide

  167. A note on immutability

    View Slide

  168. A note on immutability
    Bayou’s stable log is “immutable”
    » e.g., event sourcing, Lambda architecture

    View Slide

  169. A note on immutability
    Bayou’s stable log is “immutable”
    » e.g., event sourcing, Lambda architecture
    But what guarantees can we make about the
    outcomes in the log?

    View Slide

  170. A note on immutability
    Bayou’s stable log is “immutable”
    » e.g., event sourcing, Lambda architecture
    But what guarantees can we make about the
    outcomes in the log?
    » “Immutable” writes are the easy part!
    » Reasoning about outcomes is the challenge

    View Slide

  171. Why have “merge” at all?

    View Slide

  172. Why have “merge” at all?
    Why not just ship the stored procedures and
    re-execute them instead?

    View Slide

  173. Why have “merge” at all?
    Why not just ship the stored procedures and
    re-execute them instead?
    » Update function: transfer $100 from Jan to Peter
    » Dependency check: does Jan have $100 in her account?
    » Merge function: log an error

    View Slide

  174. Why have “merge” at all?
    Why not just ship the stored procedures and
    re-execute them instead?
    » Update function: transfer $100 from Jan to Peter
    » Dependency check: does Jan have $100 in her account?
    » Merge function: log an error
    If Jan has $100:
    transfer $100 from Jan to Peter
    Else:
    Log an error

    View Slide

  175. a

    View Slide

  176. ELE Edelweiss

    View Slide

  177. Durability?
    In this context, durability and consistency are
    effectively orthogonal
    » Durability: “survive F faults, need F+1 servers”
    » Strong consistency: usually requires “majority”

    View Slide

  178. Durability?
    In this context, durability and consistency are
    effectively orthogonal
    » Durability: “survive F faults, need F+1 servers”
    » Strong consistency: usually requires “majority”
    Bayou: local updates may not survive faults
    » But the (arguably) more fundamental part of the
    system is maintaining updates

    View Slide

  179. Bayou vs. Dynamo
    Fully replicated
    Update-one
    In-order per-server
    sequenced anti-entropy
    Server-side merge
    Global stability
    detection
    No “strong” consistency
    Partially replicated
    Update-N
    Merkle tree-based anti-
    entropy
    Client-side merge
    No notion of, API for
    stability
    Regular registers via
    majority quorum

    View Slide

  180. Talk Outline
    Background and system architecture
    Conflict detection and resolution APIs
    “Correctness” and ordering
    Lessons for all of us

    View Slide

  181. Talk Outline
    Background and system architecture
    Conflict detection and resolution APIs
    “Correctness” and ordering
    Lessons for all of us

    View Slide

  182. Why Bayou?
    “NoSQL” before “NoSQL”
    Learn from smart predecessors
    Rethink application, system boundaries
    Lucid discussion of systems challenges

    View Slide

  183. Bayou Goals
    Handle frequent disconnections
    » Embrace replication, update-anywhere

    View Slide

  184. Bayou Goals
    Handle frequent disconnections
    » Embrace replication, update-anywhere
    Reason about distribution explicitly
    » Require application semantics

    View Slide

  185. Bayou Goals
    Handle frequent disconnections
    » Embrace replication, update-anywhere
    Reason about distribution explicitly
    » Require application semantics
    Facilitate conflict detection and resolution
    » Use merge and dependency APIs

    View Slide

  186. “Weakly consistent replication
    has been used previously for
    availability, simplicity, and
    scalability in a variety of systems
    [3, 7, 10, 12, 15, 19].”

    View Slide

  187. “Weakly consistent replication
    has been used previously for
    availability, simplicity, and
    scalability in a variety of systems
    [3, 7, 10, 12, 15, 19].”

    View Slide

  188. Simplicity for whom?

    View Slide

  189. Simplicity for whom?
    Architects
    Systems programmers
    Operators

    View Slide

  190. Simplicity for whom?
    Architects
    Systems programmers
    Operators
    Application writers?
    Users?

    View Slide

  191. Simplicity for whom?
    Architects
    Systems programmers
    Operators
    Application writers?
    Users?
    Analogous issues in RDBMS design!
    http://www.bailis.org/blog/understanding-weak-
    isolation-is-a-serious-problem/

    View Slide

  192. Unfortunately, not always a choice!

    View Slide

  193. THOSE LIGHT CONES_

    View Slide

  194. 2.6 Billion Internet users in 2013
    7.1 Billion humans on planet Earth
    Who cares about scale? Coordination?
    [Mary Meeker]

    View Slide

  195. 2.6 Billion Internet users in 2013
    7.1 Billion humans on planet Earth
    Who cares about scale? Coordination?
    Will data keep increasing? Why?
    Hint: not humans.
    [Mary Meeker]

    View Slide

  196. View Slide

  197. View Slide

  198. View Slide

  199. View Slide

  200. View Slide

  201. View Slide

  202. Xerox PARC
    Laser printers
    Computer-generated bitmap graphics
    #e Graphical user interface, featuring windows and icons, operated
    with a mouse
    #e WYSIWYG text editor
    #e precursor to PostScript
    Ethernet as a local-area computer network
    Fully formed object-oriented programming in the Smalltalk
    programming language and integrated development environment.
    Model–view–controller software architecture
    Bayou!
    [Wikipedia]

    View Slide

  203. Xerox PARC
    DEC SRC
    MSR SVC
    ???

    View Slide

  204. What can we learn?
    1.) Integrating application logic is key to “correct”
    execution of “AP” distributed systems. R/W is bad.
    2.) Lack of app-specific mechanisms in a coordination-
    free system is a recipe for data corruption.
    3.) Merge/repair is a narrow API for developers to
    express their application conflicts.
    4.) Alternatives like commutativity, I-confluence, and
    research tools like Bloom can help limit overhead.

    View Slide

  205. !anks Fastly & Ines!

    View Slide