The Brief
Last-write-wins is a policy, chosen by default
The worst incident I know of had no bug in it. The code did exactly what it was designed to do.
A telehealth app. A nurse updates a patient's dose. A physician's device, which cached its read four minutes earlier, writes the old value back. The server keeps whichever request carried the later timestamp. Nothing told the physician's device to come back and check.
An engineer got paged and spent ninety minutes proving the code was working exactly as designed.
And it was. There was nothing to fix.
What there was instead was a decision nobody had made: what does it mean for two clinicians to disagree about a dose, and who is allowed to win.
That is the thing worth taking from it. Last-write-wins is not the absence of a conflict policy. It is a conflict policy, chosen by default, that resolves disagreements by comparing two clocks.
Most sync systems get built as periodic refresh plus last-write-wins, with no model for ordering, convergence, or what a conflict means to the business. It survives the demo. It survives the launch. It fails the first time two people who both matter touch the same field.
The principle underneath: consistency guarantees are a per-invariant decision, not a database setting.
Hold on to per-invariant. That app had one sync engine and several different obligations running through it. A patient's free-text visit note and a patient's active medication list are both fields that sync. They deserve opposite policies. Losing a character from a note is an annoyance. Losing a dose change is a safety event. A design that treats them the same has already failed, it just has not been caught yet.
The question to ask before you pick a mechanism , and it is worth asking on your current system this week: for each thing that syncs, what happens when two writers disagree, and who finds out.
If no metric distinguishes a resolved conflict from a lost one, the design is not finished.
The mechanism will change. WebSocket or polling, patch or snapshot, CRDT or server authority, all of it turns over across an app's life. The obligation does not, and neither does the cost of violating it.
Get the next one Tuesday
One specific career fix for mobile engineers, every Tuesday, in under 5 minutes.