Skip to main content
Vibe Code Forum

Article: Databases for beginners: tables, rows and why you need one

If your app needs to remember anything after the page is closed, for more than one person, it needs a database.

Why not just save it in the browser?

Browsers can store data (called local storage) and that's fine for a personal tool. But that data lives only on that one device and browser: switch to your phone and it's gone, clear your history and it's gone, and nobody else can see it. Shared, lasting data needs a database on a server.

How most databases are organised

Think of a set of spreadsheets that know about each other:

  • A table is like a sheet: users, notes, orders.
  • A row is one item: one user, one note.
  • A column is one property: email, created_at, title.
  • Every row has an id, and rows point at each other by id: each note has a user_id saying who owns it. That link is a relationship.

SQL is the language for asking questions of these tables, such as "all notes where user_id is 7, newest first". Postgres, MySQL and SQLite are SQL databases. Your AI tool writes the SQL; it helps to be able to read it roughly.

Other databases store documents (like small JSON files) instead of rows, such as Firestore or MongoDB. Same ideas, different shape.

Which to use

For most vibe-coded web apps: Postgres, often through a service such as Supabase, Neon or your hosting platform's database. It is reliable, AI tools know it very well, and it grows with you. See Supabase and Firebase.

Words you will hear

  • Schema: the list of tables and columns.
  • Migration: a saved change to the schema ("add a phone column to users"), so every copy of the database can be updated the same way.
  • Seed data: sample rows for testing.
  • Backup: a copy you can restore. Check your provider makes them, and try restoring once.

Good habits

  • Ask the AI to describe the tables before it creates them: "What tables will you create and why?"
  • Never let the browser talk to the database without security rules. See Stay safe from day one.
  • Keep test data and real users' data in separate projects or databases.

More in Concepts