1

Scenario:

We have a multi-tenant application in which each tenant has its own schema. There is a public schema in which a table exists containing the records of each tenant. So there is a super admin who can create tenants and assign admins to a newly created tenant.

In order to implement RBAC (Role-based access control), what I am planning to do is to place each role table into the tenant schema and implement some middleware to check for authorization. Is this a good architecture in an isolated schema environment?

Arnold Schrijver
  • 3,588
  • 3
  • 36
  • 65
Maaz Rehman
  • 674
  • 1
  • 7
  • 20

1 Answers1

1

According to this answer, PostgreSQL can handle large numbers of schemas, but can get slow for backups, administration, and upgrades.

You might also consider individual tables per tenant as you can also achieve RBAC at the table level.

bfris
  • 5,272
  • 1
  • 20
  • 37
  • Yes that i is what i am planning to do . each tenant has its role user tables .i dont see any drawback of such approach . what do you suggest ? – Maaz Rehman Jul 13 '20 at 09:02