Versioning Data and Achieving Configurability 00:00:01 Two copies accept different edits to the same label Two replicas start from one labeled value. Each client writes through a different replica while disconnected. Trace the two version vectors and determine whether either update includes the other. Both nodes hold the value A with version [A:1]. Client 1 sets the value to B at node A. Node A raises its own counter. Client 2 sets the value to C at node B, which still holds [A:1]. Is [A:2] covered by [A:1, B:1]? No, A is 2 against 1. The other way? No, B is 1 against 0. Concurrent. The application reads both, chooses C, and writes it through node B. The new version covers both. Neither vector dominates the other, so these versions are concurrent in the recorded history. A resolving write must carry both contexts if it is to supersede both siblings. 00:01:03 An ordinary update carries the context of its read Repeat the edit after a client reads the current value and version together. Watch the receiving replica compare a known predecessor with the new value's version. Both nodes hold the value A with version [A:1]. The client gets the value and its version, the context. The write B comes with the context [A:1]. Node A stores [A:2]. Node B compares: [A:1] is contained in [A:2]. It may be replaced. Both nodes agree, and nothing was lost. Dominance allows a causally older value to be replaced. A blind write that omits the context cannot demonstrate that it incorporated an earlier edit. 00:01:49 A hat and a pair of shoes arrive together A shopper adds shoes on the phone and a hat on the disconnected laptop. Open both carts after reconnection and decide what a valid merge should retain for these two additions. The phone adds shoes. Its version is [M:1], for mobile. The laptop has not seen that and adds a hat: [L:1]. [M:1] and [L:1] meet. Neither contains the other. Union of the items: shoes and hat. The laptop copy writes the result, so L goes up. The merged cart replaces [M:1] on the other side. Both devices show both items. A union works for this add-only example. Modeling removal, quantities and simultaneous changes requires stronger cart semantics than blindly combining every item ever observed. 00:02:41 The clock makes an earlier color look newer One editor picks red on a fast clock. Another selects blue three seconds later on a slower clock. Predict which value a timestamp winner keeps when the replicas compare stamps. Client 1 writes RED at node A. The stamp is 105, because the clock is fast. Client 2 writes BLUE at node B, three seconds later. The stamp is 103. 105 is higher than 103. BLUE is dropped. Client 2 got a success message. The value is now the older one. A deterministic winner can make replicas converge while losing an acknowledged intent. Give the application explicit conflict semantics and treat clock assumptions as part of the data model. 00:03:27 Two editors open version four of the price Both administrators see a price of ten at the same version. The first saves twelve. The second attempts to save nine using the version still attached to the old form. The price is 10, version 4. Both admins see that. Price 12 if the version is still 4. It is, so the database moves to version 5. Price 9 if the version is still 4. It is 5, so the save is refused and logged. Admin 2 sees the price 12 and decides with that in mind. A compare-and-set at the authority prevents a silent overwrite. Return the current value or a conflict so the second administrator can decide using the change they missed.