Started the thread
M
Mohie
@Mohhie · 13h
سؤال لو بتبني multi-tenant SaaS باستخدام shared schema، هل بتفضل تستخدم RLS على مستوي الdb ولا بتخلي الapplication code هو اللي يضمن
Multi-tenant SaaSA single software platform — like Slack or Shopify — that serves many separate business customers from one shared piece of infrastructure.
Shared schemaAll customers' data lives in the exact same database tables. A tenant_id column is what separates Company A's rows from Company B's.
RLSA database feature that blocks any query from returning rows outside the current tenant — enforced by the database engine itself, not by trusting the code.
Application codeThe backend code (Python, Node, Go...) is trusted to add WHERE tenant_id = X to every query itself, rather than the database enforcing it.