Databases
A database lets your product save things, like notes, orders or profiles, and load them again later. Supabase and Firebase both give you one, with rules for who can see what.
Do I need a database?
You need one if people add things that should still be there tomorrow, like posts, saved lists, bookings or profiles.
- If your content only changes when you edit the site yourself, like a portfolio or a menu
- Skip it. A simple form that emails you may be enough at first.
Words: Database
What’s the fastest way to add a database?
Follow a guide, or open the Supabase or Firebase tool page and follow its steps. Your AI tool writes the code, and you click through the dashboard.
In a guide
- Build a website: Choose a database
- Build a web app: Choose a database
- Build a phone app: Choose a database
Words: AI coding tool
Supabase or Firebase: which database fits my product?
It comes down to the shape of your data: tables in Supabase, loose records in Firebase. Both work for websites and phone apps.
| Question | Supabase | Firebase |
|---|---|---|
| How data is shaped | Tables with rows and columns, like a spreadsheet. Postgres is the software that stores and manages these tables. | Documents, small records with named fields, grouped into collections. |
| How access rules work | Row Level Security. Rules on each table, written in SQL, decide who sees each row. SQL is a language for reading and changing data in tables. | Security Rules. One rules file matches document paths and decides who can read or write. |
| Sign-in included | Yes. Supabase Auth, free for up to 50,000 monthly active users. | Yes. Firebase Authentication, free for up to 50,000 monthly active users on the Spark plan. |
| Testing your rules | Two test accounts, or SQL tests with the Supabase command line tool. | The Rules Playground in the console, or the Local Emulator Suite on your computer. |
Swipe the table sideways to see every column.
Words: Postgres, SQL, Row-level security, Monthly active users
Should I add a database now or later?
Add it when the first must-have feature needs to save something. Until then, leave it out and keep the first version small.
- If your first screen shows things people add, like posts or bookings
- Add it now, while you build that screen.
- If each person should see only their own things
- Add sign-in first. Then each saved item can belong to one person.
Are databases free?
Yes, to start. Both options have a free plan, and you pay once your product needs more than the free amounts in the table.
- If your free Supabase project sits unused
- It may pause after a week of low activity, so open it now and then.
| Question | Supabase | Firebase |
|---|---|---|
| Free plan limits | 2 active projects, each with a 500 MB database. The organization shares 5 GB of uncached data sent out each month, plus 5 GB cached. | 1 GiB stored, 50,000 reads and 20,000 writes a day, and 10 GiB of data sent out a month. No card needed. |
| When you outgrow free | Pro starts at $25 a month. | The Blaze plan is pay as you go, for use beyond the free amounts. |
Swipe the table sideways to see every column.
How does a database work underneath?
Your data lives on the service’s computers, not inside your product. Your product sends a request to read or write it, and your access rules check each request first.
- If your code has a public key in it
- That’s expected. Supabase’s publishable key and Firebase’s API keys can sit in your product’s code, because your access rules protect the data.
- If a task needs to skip the rules, like an admin job
- That needs a secret key, like Supabase’s secret key or a Firebase service account key. Keep it out of code that runs in a browser or on a phone.
- If you add a new table or collection
- Give it access rules before you save real data in it. In Supabase, check Security Advisor again. In Firebase, update and publish your rules.
Questions people ask
Updated Sources: PostgreSQL: table concepts, PostgreSQL: SQL language, Supabase: shared organization quotas, Supabase pricing, Supabase: Row Level Security, Supabase: API keys, Supabase: Use Supabase with Expo, Firebase pricing, Firebase: Get started with Cloud Firestore, Firebase: Get started with Security Rules, Firebase: Learn about API keys, Stack Overflow Developer Survey 2025: Technology.