Replication Lag Problems and the Guarantees That Fix Them

Replication Lag Problems and the Guarantees That Fix Them A workflow diagram generated by Archify. 01 / Lag Anomaly EX / Read-Your-Writes EX / Monotonic Reads EX / Consistent Prefix Spot the anomaly Pick the guarantee Async Follower Reads · replication lag grows · Lag Anomaly › Spot the anomaly · eventual consistency Async Follower Reads replication lag grows eventual consistency Own Update Disappears? · write, then read · Lag Anomaly › Spot the anomaly · decide Own Update Disappears? write, then read decide Time Moves Backward? · two reads, two replicas · Lag Anomaly › Pick the guarantee · decide Time Moves Backward? two reads, two replicas decide Reply Before Question? · causal order broken · Lag Anomaly › Pick the guarantee · decide Reply Before Question? causal order broken decide Live With the Lag · no guarantee needed · Lag Anomaly › Pick the guarantee · cheapest option Live With the Lag no guarantee needed cheapest option Read-Your-Writes · own data from leader · Read-Your-Writes › Spot the anomaly · or track last write time Read-Your-Writes own data from leader or track last write time Monotonic Reads · same replica per user · Monotonic Reads › Pick the guarantee · hash of the user ID Monotonic Reads same replica per user hash of the user ID Consistent Prefix · causally related writes · Consistent Prefix › Pick the guarantee · same shard, or track deps Consistent Prefix causally related writes same shard, or track deps yes no yes no yes no lag grows Legend Agent logic External system