Skip to main content

F5. Database basics

What this page helps you do

Think through the basic production questions around stored data before launch.

Why it matters

A surprising number of apps reach launch with no clear backup story, unclear migrations, or no plan for seed data and resets.

You should already have

  • an app that stores or will store data

Skip this page if

  • your app is fully static and stores no important data

What to do

Work through these questions before launch:

  1. Where will production data live? Is it a managed database, a file on a server, or something bundled inside the app?
  2. How will changes to the database happen? If you need to add a new field or table later, what is the repeatable path?
  3. What data matters enough to back up? User accounts, payments, uploaded files, settings, and customer content usually count.
  4. How do you avoid touching production by accident? Make local, staging, and production values clearly different.
  5. If something breaks, how do you restore or roll back?

You do not need a perfect database platform. You do need a clear answer to those questions.

Use a managed database unless you already know why running your own database is worth the added work.

For many first launches, a good enough default looks like this:

  • use a managed Postgres or equivalent hosted database
  • keep the production connection string out of code
  • use one repeatable migration path
  • confirm backups exist before launch
  • keep local data separate from production data

If your app is very small and single-user, SQLite can still be fine for early stages, but only if you understand where the file lives and how it gets backed up.

Common mistakes

  • treating the database as someone else’s problem
  • changing schema by hand without a repeatable path
  • not checking whether backups actually exist
  • pointing local development at production because the connection string was copied everywhere
  • assuming uploads are “in the database” when they actually live somewhere else

Next step

Go to R1. Backups, then T5. Database not connecting if the live app cannot reach the database.

Advanced notes

Hosted databases remove a lot of operational pain, but they do not remove the need to understand backups, migrations, and restore risk. Managed does not mean magic.