What Data Lives Where
Sort every piece of data by where it lives and how it could be lost. The answer decides what needs a backup, and what Git already protects.
Start with an inventory
You cannot back up what you have not listed. For each kind of data, write down: where it lives, who creates it, and what would happen if it disappeared.
The four homes of this site's data
1. Git: code and content. Every page of writing, every template, every setting file and every test. Created by me, changed only through pull requests, copied on GitHub and on every machine that has the repository. Git is the backup: every past version of every file can be recovered.
2. Firestore: data visitors and the site create.
- accounts and what each account has access to;
- Sunday Note subscribers;
- likes and feedback;
- the payments ledger;
- the private Ravi OS workspace, tasks and history;
- health-check and speed history.
None of this is in Git. If it is lost, it is gone, unless a database backup exists.
3. Cloud Storage: files. Photos and some generated reports. Originals of photos also exist elsewhere; generated reports can be regenerated.
4. Outside services. Analytics history lives in the analytics service; payment records also live with the payment provider. Those providers keep their own copies, but you depend on their retention.
Sort by how painful a loss would be
| Data | Lost means | Can be rebuilt from | Protection |
|---|---|---|---|
| Code and content | Nothing, while GitHub or any clone exists | Git history | Git |
| Subscribers, accounts, ledger | People and money records gone | Nothing | Database backups and point-in-time recovery |
| Ravi OS workspace | Plans and history gone | Partly from memory | The app keeps 10 versions, plus database backups |
| Health and speed history | Charts restart from empty | Nothing, but low value | Database backups |
| Photos | Pictures missing | Originals elsewhere | Keep the originals; consider bucket versioning |
| Generated reports | Nothing important | Re-run the script | None needed |
The table makes priorities obvious: the Firestore data is the part that needs real backups, and within it, subscribers, accounts and the payments ledger matter most.
Two numbers for each row
- RPO, recovery point objective: how much recent data you can afford to lose. "At most a day" means a daily backup is enough; "at most a minute" needs continuous protection.
- RTO, recovery time objective: how long you can take to restore. "An afternoon" is very different from "five minutes".
For a site this size, a sensible target is: lose at most minutes of subscriber and payment data (point-in-time recovery), restore within an afternoon, and practise once a quarter.
Small protections already built in
- The Ravi OS store keeps its last 10 saved versions, so a bad save or an "erase all" can be undone from inside the app. That protects against mistakes, not against losing the database.
- Writes are shaped to what Firestore accepts. Firestore refuses arrays inside arrays, so a small helper wraps nested rows and unwraps them on read, with tests that use a fake database that refuses the same things.
- Counts that many people update at once (likes, subscriber sign-ups) use one document per item or atomic increments, so simultaneous updates are never lost. An older design kept likes as one list in a storage file and lost some under load. A test now sends 25 simultaneous likes and expects all 25 to count.
Try it yourself
Build the table above for your own system. Any row where "can be rebuilt from" says nothing and "protection" is empty is a risk you are carrying today.