The newest timestamp came from the least authoritative source
Failure story 09, in time, ownership and inter-agency data.
The challenge
Section titled “The challenge”The integration hub keeps whichever record has the newest timestamp. A resident verified their new address in person yesterday. Why does the hub show their old address today?
The setup
Section titled “The setup”| Assumption | Value |
|---|---|
| Hub | A state integration hub that merges person records from several agencies |
| Owner of mailing address | The benefits agency, which verifies addresses with residents |
| Partner | A licensing agency that sends a nightly export of everyone it serves, including the address it has on file |
| Merge rule | Last write wins: the record with the newest updatedAt replaces the hub’s copy |
Partner’s updatedAt |
Set to the export time for every row, because its old system doesn’t track when each field changed |
What happened
Section titled “What happened”| Step | What happens | Hub’s address |
|---|---|---|
| 1 | Jan: the licensing agency records the resident at 12 Elm St. | 12 Elm St |
| 2 | Nov 20, 2 p.m.: the resident visits the benefits agency, shows a lease and verifies 48 Oak Ave. updatedAt Nov 20 14:00. |
48 Oak Ave |
| 3 | Nov 21, 1 a.m.: the licensing export runs. The resident’s row says 12 Elm St, with updatedAt Nov 21 01:00. |
48 Oak Ave |
| 4 | The hub compares timestamps: Nov 21 is newer. | 12 Elm St |
| 5 | Next week the renewal notice goes to Elm St. The resident misses the deadline and loses coverage for a month. | 12 Elm St |
Why it went wrong
Section titled “Why it went wrong”Last-write-wins compares when a record was sent, not when the fact changed or who has the authority to change it. The partner’s timestamp described the export, not the address, so a nine-month-old observation looked like the newest news. And the hub treated every source as equally entitled to set every field, when only one agency verifies addresses with residents.
Two designs
Section titled “Two designs”| Aspect | Design A: timestamp precedence | Design B: field ownership and source revisions |
|---|---|---|
| Who may set the mailing address | Whoever sent the newest record | Only the owning agency |
| Which time is compared | Export or arrival time | The source’s own revision of the field: when that source last changed it |
| What happens to a partner’s different value | Overwrites | Stored as an observation: Licensing reports 12 Elm St as of January |
| Who sees the conflict | Nobody | The owning agency’s caseworkers, on the person’s record |
Write the ownership down as data, not as code comments, so it can be reviewed by the agencies that own it:
| Field | Owner | Others may | Compare by |
|---|---|---|---|
| Mailing address | Benefits agency | Report observations | Owner’s revision number |
| Legal name | Vital records | Report observations | Owner’s revision number |
| Driving license status | Licensing agency | Read only | Owner’s revision number |
| Phone number | Any agency | Update | Source change time, newest wins |
The last row matters: last-write-wins isn’t always wrong. It’s a reasonable rule for a field nobody owns, provided the timestamp is the time the value changed.
The check
Section titled “The check”- The verified address survives. Apply the owner’s verified update, then a partner record with an older address and a newer export time. Expected: the hub’s address is still 48 Oak Ave.
- The conflict stays visible. Expected: the person’s record shows the licensing agency’s observation, 12 Elm St, with its source and date.
- The owner can still change it. Apply a later update from the owner. Expected: it replaces 48 Oak Ave.
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”- One system owns the record and the others only read it.
- Every source sends the time each field actually changed, all sources are equally authoritative, and clocks are trustworthy. All three conditions, not one.
For educators
Section titled “For educators”Discussion question. “Which agency owns the mailing address?” is a policy question. Who in a state government can answer it, and what happens to the integration project while they decide?
Exercise. This time the partner is right: the resident moved again and told the licensing agency first. Under Design B, the licensing observation is newer and correct, but the hub keeps the owner’s address. What should happen, and who acts?
Worked answer
Ownership doesn’t mean ignoring other sources; it means the owner decides. A partner observation that differs from the owner’s value and is newer by the source’s own revision should create a task for the owning agency: contact the resident, verify, and update or dismiss. Until then, both values are visible and the owner’s stays authoritative. Some states add a rule that a notice with a legal deadline goes to both addresses while a conflict is open. Notice that this is a business process, not a merge algorithm: the design’s job is to make the conflict impossible to miss.
Related pages
Section titled “Related pages”Written and edited by Abhinav Taduka, enterprise software architect.
New pages are added regularly. Follow Abhinav on LinkedIn to see them first.