-
Hi, I'm picturing my needs and the steps I would need to switch from Next to Remix on my current project to give it a try in a real world situation. I'm currently using Supabase as my auth + database + storage backend. As I understand all the data interactions are server-sided (to fully exploit Remix), I feel I'll loose the Supabase capabilities regarding the row level security (RLS) offered by Postgres that allows to restrict access to the data based on the user's id and role that initiated the request. It all started from this discussion here:
Anyone having experience with that and/or a smart way to keep using the best of these both worlds, that is Remix & Supabase? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 8 replies
-
Some additional thoughts coming from a thread in Discord:
This is true thanks to PostgREST and the Supabase JS library on top of it. +1 point for DX
Is it really? Aren't the RLS rules bypassed when using the
The question is indeed: do you want to safe guard queries in Postgres (pgplsql/sql) or in Remix (javascript). I'd say handling this in the database itself make your code less prone to error, or at least more consistent: the same rules applies wherever you call the data in your Remix app. |
Beta Was this translation helpful? Give feedback.
-
Writing from a Firebase perspective here, but Firebase and Supabase aim to solve similar problems. Supabase (as well as Firebase) allows the clients directly to communicate with the backend (auth & databases), without requiring a server in between. For (native) App developers, this mostly eliminates the need to write their own backend. But you need to be more confident on your database security, since clients are allowed to interact with your databases directly. This brings its own complexity, plus sometimes you need to find a database structure, that allows for the security settings, that you have in mind. I remember having trouble with confusing access rights in a Firebase Database, finally ending up with cloud functions in between because it was so easy with code and so complicated with the security rules. When you start developing a NextJS or Remix application, you're implementing your server anyway. The (recommended) NextJS approach is still client-side data fetching with |
Beta Was this translation helpful? Give feedback.
-
Following a Discord thread, it seems there are several way to use the two of them (at least from the Postgres-RLS-stuff perspective):
|
Beta Was this translation helpful? Give feedback.
Following a Discord thread, it seems there are several way to use the two of them (at least from the Postgres-RLS-stuff perspective):
loaders
/actions
you would use theanon_key
and mock the user rights by using JWT-token-stuff (<-- that's the part I still need to figure out 😆),service_role
(admin) key.