The situation

Your prototype remembers a setting on your laptop. A second person opens the site and sees nothing. You add a database, then discover that half the old information still lives in the browser and the other half is copied into a file nobody meant to publish.

The idea in one paragraph

Data needs a deliberate home. A file is simple and portable, browser storage belongs to one browser, and a database gives many users one managed source of truth. The right choice depends on who needs the data, how long it must survive and what would happen if it were lost or exposed.

Three common homes

HomeUseful forMain limit
Project fileConfiguration and portable contentMay be copied or published with the code
Browser storageOne person's local preferencesDoes not follow every user or device
DatabaseShared, changing application recordsNeeds access rules, backups and migrations

How it actually works

Every write creates an owner and a lifetime. Ask who may read it, who may change it, how it is found again and when it should disappear. A database is not automatically safer than a file; safety comes from access rules, careful queries and recovery copies. Moving later means translating old data and checking that nothing was lost.

What this changes for you

  • Write down the home of each important kind of data.
  • Keep secrets and personal data out of project files and browser storage by default.
  • Plan export, backup and deletion before the data becomes valuable.

Where it breaks

A convenient local store can be correct for a private prototype and wrong for a shared product. A database can also be unnecessary weight for content that rarely changes. Choose for the real users and lifetime, not for the most impressive architecture.

Terms used on this page

  • Source of truth: the place treated as the authoritative current value.
  • Migration: a controlled change to data structure or location.
  • Access rule: a condition deciding who may read or change data.

Connecting services covers what changes when data crosses from one system into another.