Deleting an account and surviving a failure need a job in both models
One local transaction, then a job that retries; the models differ in what stops when a part is down.
Deleting Ana takes one local transaction and then a job that retries
Ana asks us to delete her account. Her rows sit in Singapore, as copies in 2 more regions, and in the global database.
No single transaction reaches all of them. So the delete has a fast first step and a job behind it:
- Step 1One transaction in SingaporeAll of Ana's private rows and shared rows go. A delete marker and a delete job are written. 6 ms in the test.
- About 0.1 sCopies vanishPostgres removes her shared rows from US West and Frankfurt.
- About 0.2 sCleanup workers actEach region removes rows that pointed at Ana: likes, friend rows, results.
- After thatThe job finishes outside SingaporeIt removes her unique names from the global database and her login. It retries until done.
Step 1 is all or nothing. The rest is repeatable, so a crash only delays it.
We ran this in the call design. The numbers:
Every delete finished clean, also when the app was killed half way. Measured, simulated distance
The 3-place rule keeps the same shape. Its job has more to do in the global database: Ana's seats, and the quests she owns.
One case needs care in both models. Ana owns a quest with paying members. Deleting her must give their gems back. In the test, every gem came back exactly once, 30 of 30 times. Measured, simulated distance
A delete does not reach four places, in either model
The databases end clean. Four other places still hold traces of Ana:
- BackupsOld backups still contain her rows until they expire. Not tested.
- Application logs157 log lines in the test still named her id.
- Free-form columns2 rows kept her id inside a saved answer, where no link points.
- Database write logHer rows stay in the write log until Postgres recycles it.
The log lines and the 2 rows were counted in the test. Measured Backups were not tested. Not tested
These places need rules of their own: short log life, and no person ids in free-form columns.
When a part fails, the two models stop different features
Both models keep private data working through any failure outside the home region. They differ in what else stops.
This table shows what a person notices:
| What fails | 3-place rule | Call design |
|---|---|---|
| Link between 2 regions | Nothing stops, copies arrive late | Joining a quest owned in the cut-off region waits |
| Link to the global database | The cut-off region cannot join any quest or sign up | The cut-off region cannot sign up |
| Global database down | No joins and no sign-ups, in every region | No sign-ups, in every region |
| The region of the global database down | Its people cannot write; no joins or sign-ups anywhere | Its people cannot write; no sign-ups anywhere |
| One other region down | Its people cannot write; other quests go on | Its people cannot write; their quests stop for all |
The 3-place rule ties more features to one database. The call design ties each quest to its owner's region. Estimate
In the call design test, a link was cut for 10 and for 60 seconds. Local writes went on, and 0 rows were lost. Measured, simulated distance
One failure has no answer in either model. When a person's home region is down, that person cannot write. Private data has no second home.
The 3-place rule itself never ran; here is what is still untested
Every number for the call design came from one machine with simulated distance. The 3-place rule has no run at all.
- The 3-place rule: every number for it is the measured trip time, multiplied.
- Real networks and real hosted databases; the tests used one machine.
- A regional database that is down; only apps and workers were stopped.
- Backups, and deleting a person from them.
- Real clocks for deadlines; the tests drove time by hand.
- A whole home region that is down; this is not designed yet.
So the next step after a yes is small. We run scenarios 5 and 6 in the 3-place rule and compare.
The 4 questions that started this explainer, each with its short answer:
- QWhat is wrong with the simple 3-place model?
- ANothing for correctness. It costs about 0.2 seconds on far writes, mixed actions are not one transaction, and the global database is a single point. 3 guard rules keep that small.
- QWhat is a foreign key for, and how important is it?
- AIt makes the database refuse a broken link, with no code of ours. It is essential for money and limits, and it works only inside one database.
- QWhen is a link strong, and when weak?
- AStrong when both rows live in one database. Weak when they do not; then 5 small parts keep it right within about 0.2 seconds.
- QHow does each scenario play out?
- APosts, likes, friends and quest days are local writes in both models. Seats differ in who waits. Paid joins and account deletes need steps and a job in both.
Each answer points back to one page above. What happens next is short:
- YouAnswer the 3 questions on the Decide page.
- WeAfter a yes, run the seat and the paid join in the 3-place rule and report real numbers.
The run in the 3-place rule costs nothing: it uses the same machine as before.