Cloud & Infrastructure
Resolving edits when two devices change one record
Any sync product eventually faces the same question: what happens when two devices edit the same record before they meet? This guide walks through a practical way to decide and explain the answer.
01
Step one: define the record and its fields
Start by deciding what counts as one record and which fields can change independently. Take a field technician's job ticket edited on a tablet while a dispatcher updates it in the office. If the tablet changes the status and the dispatcher changes the address, those edits do not truly collide and can merge field by field. Treating the whole ticket as one block would force a needless conflict. List each field, note who usually edits it, and mark any that must stay together, such as a quantity and its unit. This map becomes the basis for every later rule.
02
Step two: choose a rule for each kind of clash
When the same field changes in both places, pick a rule on purpose. Last-write-wins is simple but can silently discard work, so reserve it for low-stakes fields like a view preference. For the job ticket, status might follow a defined order so that completed never reverts to in progress. Free-text notes could be combined, keeping both entries with timestamps and authors. Fields tied to money or safety may need a person to decide. Record the rule beside the field definition so engineers, support staff and customers can predict the outcome.
03
Step three: show the result and keep a trail
Resolution is only trustworthy when people can see what happened. In the job ticket example, the dispatcher might see a short notice that the tablet's status was kept and the address was merged, with an option to view both versions. Store a change history with time, device and prior value so a mistaken outcome can be reversed. Test the rules by simulating offline edits on two devices, then reconnecting them in different orders. If the final record differs depending on order, the rule needs refinement before it ships to real users.