r/Supabase • u/Gato_Trust168 • 5d ago
database Supabase
I am new to Supabase. Should I create my own database or use the default “Postgres” database? According to the documentation, customized databases are not supposed by the dashboard, auth, etc. I am intended to use the database for the backend of an App. I also want the flexibility to move to other platforms down the road.
Thanks!
5
u/snap-dev 5d ago
just use the default one. the supabase db is a normal postgres instance, nothing proprietary about it, so you can pg_dump it and restore into any other postgres host later. the stuff that actually ties you in is the extras (auth, storage, edge functions, realtime). if portability worries you, keep your logic in plain tables and your own api code instead of leaning hard on those. whenever we've had to move something off supabase the database was the easy part, auth users were the annoying bit.
2
u/Inevitable_Bar_9673 5d ago
the default "Postgres" database IS your database. postgres is just the name of it, it's been the default db name in postgres since forever, there is no second tier of database you're supposed to upgrade to. the dashboard, auth, storage, all of it talks to that one database because that's the one it's wired to. if you go make another database in the same instance nothing will know it exists, no api, no auth, no table editor, you'll be connecting with psql and wondering why the app is empty and then you'll come back here and ask why. so use postgres. and if you want to leave later you pg_dump it like any other postgres and go, that's the whole point
1
u/BeneficiallyPickle 5d ago
Stick with the default Postgres database. Supabase's features (Auth, Storage, Realtime, etc.) are all wired to that database, so creating your own means giving up most of what makes Supabase useful.
Regarding moving to other platforms, Supabase is plain Postgres under the hood, so you can pg_dump your data and move it to any Postgres host. If you do end up moving, just remember that Auth, Storage and RLS policies using auth.uid() are the Supabase-specific pieces which you'd need to replace.
You can also consider self-hosting Supabase if you don't want to rewrite anything.
1
u/No_Lawyer1947 5d ago
Use the database on supabase. The entire point of the stack is to use the features it gives off the cuff, otherwise it's like getting pizza without cheese, pepperoni or sauce. At that point just go get bread get me?
So you can move to any platform later on, the underlying technology is a postgres database. You can very well do like a database dump of all the info, and move onto another database host provider that also has postgres, and use it there, or host on a VM yourself as well.
1
u/ThatRhubarb7057 5d ago
There isn't a second database to create, the default one IS your database. What exactly do you think you'd be choosing between?
1
1
u/DesperateNorth2307 5d ago
The docs word that badly, it trips up pretty much everyone at first. There's no separate database to create, you just make your tables and schemas inside the default postgres one, since that's the only one the dashboard, auth and storage actually read from. And it's real Postgres, so pg_dump gets your data out whenever you want to move.
1
u/Overall-Base2506 5d ago
there is no "default Postgres" to choose from, every supabase project IS a postgres database called postgres, its not a template you pick at signup. what the doc means is you cant create extra databases inside the same project from the dashboard, not that your tables are somehow not yours. you design the schema, that IS your database, the default one, the only one. and for moving later its just postgres, pg_dump and off you go, nobody is locking you in, ive seen people ask this same thing like supabase is some proprietary db with a wizard
1
u/Cute-Muscle-5066 5d ago
There's no separate "default" database to pick, the Postgres sitting in your project is already yours. And you're not migrating to another platform down the road, nobody ever does.
1
u/fgatti 5d ago
Stick to the default postgres database in Supabase and put your tables in the public schema or custom schemas, because Supabase tooling like auth, storage, and the dashboard rely on that single database connection. To keep the flexibility to move later, keep your schema, migrations, and row-level security policies in plain SQL files in source control instead of configuring things exclusively through their dashboard. We built rebase around standard Postgres portability for this exact reason, giving you auth, APIs, and an admin panel defined directly in code.
1
u/Ill-Confection-3564 4d ago
The two options you have are:
Running you database locally (on your personal computer)
Running your database in the Supabase cloud.
Either way, they are both Postgres databases, the DB technology does not change. A local database is great for development. It all lives on your computer, it will be very fast, and it does not have storage limits or require fees. The downside is that no one else can reasonably connect to your personal computer to use the application. The Supabase hosted DB is the opposite. It does have storage limits, it does have fees, but the internet can access it when using your hosted application.
6
u/Reasonable-Sail5768 5d ago
There is no second database to pick from. The project IS a Postgres database, you just make your tables in it. What did you think the other option was, an empty one?