To handle tenants you can having the next methods:
- Per tenant a database
- Per tenant a schema
- a discriminator in each column of each table
- for each tenant a set of tables: extend the table name with the tenant.
The first two are implemented, the third is not implemented yet but can be done with a query filter. However the fourth is not mention yet, however, this option has advantages. When a table grows large the performance will decrease, so when one of your 100 tenants has a lot of data he should suffer not the small ones. The other advantage is that when a company wants its data, you can easily give it to that company (tenant). see https://forum.hibernate.org/viewtopic.php?f=1&t=1043114 |