[Question] Best Practice for RLS Key: Using auth.users.id vs supabase_id Column?
Hi Supabase community! 
I’m prototyping a large-scale application and evaluating the best schema design and RLS/RBAC patterns. I came across the official Supabase YouTube tutorial where they add a separate
Context & Goals:

Tags: #RBAC #RLS #Prototyping #SchemaDesign #Supabase
I’m prototyping a large-scale application and evaluating the best schema design and RLS/RBAC patterns. I came across the official Supabase YouTube tutorial where they add a separate
supabase_id column in the public users table to mirror auth.users.id, but for complex, high-traffic systems I’m not sure this is the optimal approach.Context & Goals:
- Implement a robust RBAC mechanism where roles (e.g. Admin, Editor, Viewer) control access across multiple schemas and tables.
- Enforce row-level security so users only see their own data, and roles can override this for administrative operations.
- Prototype quickly without introducing redundant columns or unnecessary joins.
- Following the tutorial’s pattern: adding
supabase_id UUIDinpublic.users, populated viaDEFAULT auth.uid()and triggers. - Writing RLS policies that compare
toauth.uid()supabase_id, which adds casting complexity and extra joins. - Considering directly using
id UUID PRIMARY KEY REFERENCES auth.users(id)inpublic.users, then layering RBAC roles.
- For prototyping a large application, is it better practice to keep a single
column inidpublic.userslinked straight toauth.users.id, or to maintain a separatesupabase_id? - How would you structure RBAC roles and permissions at scale—would you extend RLS policies, use custom PostgreSQL functions, or integrate a dedicated roles table?
- What database design patterns or diagrams do you recommend for quickly iterating on RBAC/RLS before productionizing?
Tags: #RBAC #RLS #Prototyping #SchemaDesign #Supabase
