Learn

GuideData & storage

Where your app saves things: databases, caches, and backups

You press “Save.” The button changes. You close the tab. Will your work be there tomorrow? Will it appear on your phone? Could you recover it after a mistake?

Those are different questions. They depend on where the app stores information and how it protects it.

Follow one saved item

Imagine an app called Pocket Shelf. It saves a reading list. We will use one invented item: “Growing herbs on a windowsill,” marked unread.

In an account-based version, the app could send that item to its backend. The backend checks which account is making the request and stores the item in a database. Later, it retrieves the account's items for display.

The item might contain an ID, a title, an owner ID, and a read/unread value. An ID is an identifier that lets the app refer to a particular record even if its title changes.

An account-based reading-list app uses current database records, may reuse a cache, and backs up data for a restore into a separate test environment. Uploaded files and browser-only alternatives need separate consideration.

Swipe sideways to see the whole diagram, or open it full size.

What happened to the saved item?. A cache supports speed. A backup supports recovery. Copies can hold different versions, so freshness and recovery are separate questions.

Figure explanation: Pocket Shelf, a fictional reading-list app, sends a save operation to a database and retrieves current records. A reusable result can be copied from the database to a cache and reused by the app when allowed. A separate path backs up the database and restores that recovery copy into a separate test environment. Clearing the cache does not delete the current database record. The test restore changes only the separate test copy. Two notes explain that uploaded images may live in file storage and that a simpler browser-only design does not automatically synchronize to another device. This is one possible architecture, not a required structure for every app.

Sources

  1. PostgreSQL, Concepts. Relational databases are one database family, not the definition of all databases. Checked 2026-09-25.
  2. MDN, Web Storage API. Checked 2026-09-25.
  3. Cloudflare, R2 overview. Used only as a primary example of object storage; no provider recommendation or pricing claim. Checked 2026-09-25.
  4. MDN, HTTP caching. Checked 2026-09-25.
  5. PostgreSQL, Backup and Restore. The restore drill described above is Botski's editorial recommendation, not a claim that all services provide automatic recovery. Checked 2026-09-25.

Cookie preferences