Do you have any particular ideas on why it may not work?
I must admit I am not well aware of internals of cache frameworks but AFAIK Hazelcast uses keys and hashcode as data store keys which might be same for objects persisted in different databases. How can we segregate/partition data for different DBs in Hazelcast?
Seems like a valid concern, but needs deeper investigation.
Perhaps you should either avoid using Hazelcast and entity/query caches at all, or use only entity cache for entities with UUID keys.
Hi Jmix Team!
Jmix version: 2.4.4
Jmix Studio plugin version: 2.5.1-243
We have been working on a multi-tenancy project for a year. Now we want to make it a multi-database project with one database for each tenant. But if we export the user table with tenants to the shared database as shown in the example, there are too many entities in the main database linked to user and tenant tables. Then of course it gives errors like ERROR: relation "public.jb_user" does not exist
. What advice can you give for such kind of cases?
So how can we join the user table to the entities in the main db?
A trivial idea: create the User table and entity in the main DB and insert records with users of the corresponding tenant.
Hi Jmix team!
I have a question about io.jmix.core.security.SystemAuthenticator
service on multidb multitenancy approach, when I use runWithUser
or begin
with specific username but it doesn’t load data from that database which is created for user tenant. How can I resolve?
Could you give me some advice…
Hi Abdulmalik,
In the multidb-multitenancy-sample project the database is determined by the tenant stored in the user session. The system authentication does not create any session, so currently it’s impossible to use a tenant database inside a “system-authenticated as a user” block.
Perhaps the DataSourceRepository
can be improved to somehow determine a tenant from the system authentication too, but it’s not a trivial change.
Regards,
Konstantin