DEV Community

Discussion on: The good parts of Supabase

Collapse
 
awalias profile image
awalias

Hey Noah! Great article, thanks for your thoughts on all of this!

Perhaps I can help shed some light on our choices at Supabase regarding the client especially around data fetching.

You cannot execute raw SQL queries from the Supabase client

We find it generally more useful in a severless environment to query the db via a RESTful interface (this is why we adopted postgrest), you don't run the risk of running out of direct connections, and in general it keeps the attack surface area lower therefore the security model much easier to manage (especially if using auth + db with Row Level Security).

But as you mentioned there are times when pure SQL is useful, for this we find that using something like postgresql-client (or any of the other popular pg clients) is a much more complete and explicit way to do this.

Secondly regarding data processing and aggregation:

I think Supabase edge functions could handle this use-case well. I haven’t tried them out since I’m happy with Next.js API routes hosted on Vercel.

Yes! This is exactly the use-case we have in mind for functions. You can also use supabase-js inside your Next.js API routes, it's isomorphic and designed to work just as well on the backend as in the client.

Again thanks for your write up here! It raises some very valuable points which we feed directly into improving the product - and it's very interesting to hear about your story working on Railtrack, I'll be trying it out for sure next time I'm in Switzerland!! All the best!

Collapse
 
noahflk profile image
Noah Falk

Thanks for reading my article and your thoughtful response! It's great to see how your team is constantly improving Supabase. Excited for what's ahead.