Scorecard so far
The same rules beyond Postgres
You don’t have to choose: SpiceDB decides, Supabase still enforces
- Relationships go to SpiceDB as people share documents, join teams and move folders.
- A sync keeps an access table in Postgres current, driven by SpiceDB’s change stream.
- One short RLS policy reads that table, so the Data API, Realtime and pgvector queries stay protected inside the database, as Supabase intends.
- Writes, sharing dialogs, search and agents call SpiceDB for checks, “who can see this” and permission-aware lists.
What Supabase RLS does best
- Runs inside Postgres on every request, even through third-party tools
- Always consistent with the data in the same transaction
- Perfect for owner-only and simple team rules
- Protects the Data API, Realtime and pgvector with no extra service
What SpiceDB does best
- Nested teams, folders and organizations at any depth
- Shares with people or teams, with expirations
- “Who can see this, and why?” for share dialogs and audits
- One set of rules for Postgres, search, other services and AI agents
Worth knowing
Supabase’s performance guide notes that list-based policies past about 1,000 items may need a different approach. For people who can see very many documents, filter with SpiceDB’s lookups in your query or an Edge Function rather than a long access list. The synced table is as fresh as the sync, typically seconds behind SpiceDB.
SpiceDB schema, final
Supabase + SpiceDB: the RLS side
Supabase RLS alone, final
Illustrative SQL following Supabase’s guidance (wrap auth.uid() in select, avoid joins to the source table, security definer helpers). Add indexes on every filtered column.