The records that could be merged but never separated
Failure story 12, in time, ownership and inter-agency data.
The challenge
Section titled “The challenge”Two residents were wrongly matched and merged into one record. For three weeks, two agencies kept updating it. Now an operator has found the error. Whose update is whose?
The setup
Section titled “The setup”| Assumption | Value |
|---|---|
| Residents | Two different people, both Maria Garcia, both born April 2, 1980, in different counties |
| Matching | A nightly job merges records with the same name, date of birth and a similar address |
| Merge | Destructive: one record survives, the other is deleted, and the survivor takes the newest value of each field |
| Updates | Caseworkers at two agencies update the surviving record directly |
What happened
Section titled “What happened”| Step | What happens |
|---|---|
| 1 | Night 1: the match scores 0.91, above the 0.90 threshold. Record P-2 is merged into P-1 and deleted. |
| 2 | Week 1: agency A records new income for its Maria. It goes on P-1. |
| 3 | Week 2: agency B records a new phone number and a dependent child for its Maria. They go on P-1. |
| 4 | Week 2: a caseworker corrects the address on P-1 after a phone call. Which Maria called isn’t recorded. |
| 5 | Week 3: agency A denies its Maria’s application: P-1’s household now has a child, so the income test uses a different threshold. |
| 6 | Week 3: Maria A calls to ask about the child on her record. The error is found. |
| 7 | There’s no P-2 to restore, and P-1’s history doesn’t say which source each update came from. |
Why it went wrong
Section titled “Why it went wrong”Merging is a judgment: these two records are probably the same person. A destructive merge turns that judgment into an irreversible fact. Every later update compounds it, because each is written to a record that represents two people, without saying which one it was about. By the time the judgment is shown to be wrong, the information needed to undo it is gone.
Two designs
Section titled “Two designs”| Aspect | Design A: destructive merge | Design B: reversible links and provenance |
|---|---|---|
| Source records | Overwritten or deleted | Kept, each with its own ID: Agency A record 5531, Agency B record 8820 |
| The match | Becomes the record | A link between source records and a person, with the score, the method, and who or what made it |
| An update | Written to the merged record | Written with provenance: which source record, which agency, which user, when |
| Undoing the match | Not possible | Remove the link; updates that came through a source record return to it |
| Updates with no source | Indistinguishable | Explicitly listed for review |
Under Design B, splitting the person sorts every update into one of three lists:
| Update | Provenance | After the split |
|---|---|---|
| New income | Agency A, record 5531 | Returns to Maria A |
| Phone number, dependent child | Agency B, record 8820 | Return to Maria B |
| Address correction | Entered on the person by a caseworker; no source record | Listed for review: someone has to call |
The check
Section titled “The check”Merge two test residents, apply updates through each agency’s source record and one update directly to the person, then split them.
- Attributable updates go home. Expected: each update that came through a source record ends up on the correct resident.
- Ambiguous updates are named, not guessed. Expected: the direct update is on a review list with who entered it and when, and on neither resident until someone decides.
- Nothing is lost. Expected: the number of updates before the split equals the sum of both residents’ updates and the review list.
This check is in the checks catalog as test templates in Java and Python.
When the simpler design is enough
Section titled “When the simpler design is enough”- Records are matched on a reliable shared identifier and never on probabilistic rules.
- Merges are reviewed by a person before they take effect, and the volume is small enough that this is true in practice, not only in the procedure.
For educators
Section titled “For educators”Discussion question. What should the matching threshold be? Who pays for a false match, and who pays for a missed one? In a benefits system, they’re usually different people.
Exercise. Agency A’s denial in step 5 used the merged household. After the split, what must happen, and what does the system need to have recorded for it to be possible?
Worked answer
Every decision that used data from the merged record must be found and re-evaluated with the correct person’s data: Maria A’s application is reassessed without the child, and she’s notified of the corrected outcome and her rights. Finding those decisions requires each decision to record its inputs and their provenance, not only its outcome. If decisions store only denied, the agency can’t tell which denials were affected and has to review every decision made for either person during the three weeks. This is the same principle as recording calculation inputs and an append-only decision log.
Related pages
Section titled “Related pages”- Public sector benefits
- Healthcare interoperability, where patient matching has the same trade-offs
- Example Lending, ADR-007: keep an append-only decision log
Written and edited by Abhinav Taduka, enterprise software architect.
New pages are added regularly. Follow Abhinav on LinkedIn to see them first.