vercel / nextjs-subscription-payments

Clone, deploy, and fully customize a SaaS subscription application with Next.js.
https://subscription-payments.vercel.app/
MIT License
6.08k stars 1.23k forks source link

Why Supabase and not just PG? #205

Closed gamedevsam closed 1 year ago

gamedevsam commented 1 year ago

This is great, but for several reasons (including cost), I decided to roll my own PG instances.

I looked at the migrations and seems like just about everything is compatible with plain old postgres except the RLS which uses a function Supabase injects into their PG instances: auth.uid()

Do you have any advice on how to implement the same functionality without relying on Supabase?

PS:

Any example you guys offer with plain PG would work great with Supabase, just saying.

lms11 commented 1 year ago

AFAIK, Supabase is open-source so you can deploy your own instance as well. They also provide a backend layer that makes this project nearly trivial to implement. On the other hand, doing all of that on top of Postgres directly would be much more time consuming.

PS: I'm not a maintainer on this project.

thorwebdev commented 1 year ago

I'll leave this one for @leerob and team to answer as I'm highly biased as a Supabase employee. That being said, the big benefit of using Supabase here is the connectedness of Auth with the DB using row level security policies, making it easier to manage the business logic of who can see what data.

leerob commented 1 year ago

A few thoughts:

Hope this helps!