3 ms·
How does this compare to having a separate Postgres schema per tenant? You'd need to make your app a bit more complicated (to set the right schema before every
by lucaspiller 10y ago
How does this compare to having a separate Postgres schema per tenant? You'd need to make your app a bit more complicated (to set the right schema before every query), but you won't need to denormalise.
- lifeisstillgood 10y agoThis is really a judgement call. If you are expecting volumes of tenants in the thousands, a schema per tenant is slightly crazy. I would personally only think of a schema or database per tenant if I had either customisation issues (If most of the sale is in professional services) or worse if we have data regulation issues (an Indian tenant, an EU tenant and a US tenenat would be challenging to manage the complex data transfer laws around, and it might be easier to have geographically located servers) But unless you have few small expensive clients then I cannot see much value in multi-tenanting via schema or database. It's hard enough keeping that in mind when using Dev/UAT/prod schemas !
- dspillett 10y agoSchema per tenant from the application's point of view is much the same as database per tenant. The key difference is that sharing objects is easier if you have common procedures/data as you can keep objects that are not specific to each tenant in a separate schema (commonly the default schema, "public" in postgres or "dbo" in SQL Server).