mybatis, hazelcast and multi--tenant applications

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

mybatis, hazelcast and multi--tenant applications

foxesout
Hello,
I have an application where each client is using their own database but the Java app itself is shared between more than one client.  The database connection is determined by the URL the client used to access the app.

I'm using hazelcast to enable caching of certain mybatis mappers (<cache type="com.myproject.cache.LoggingHazelcastCache"/>).  
Now what would happen if the first client got results for the query and stored them in hazelcast cache where the data came from the 1st client's DB.
Now the second client is executing the same query and looking up the query results in cache.  Would he pick up what is already stored there from the 1st client's DB?
Is there a way to mark each cache entry with the client's/tenant's name?  Would this multi-tenant paradigm even work with hazelcast cache via mybatis the way we have it setup?
What is the best way to approach this problem?  Ultimately, each tenant should have his own cache but i'm not sure it's possible to specify that via mybatis mappers.

Thank you very much for your help.
NK

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: mybatis, hazelcast and multi--tenant applications

foxesout
Am I going about this in a completely wrong way?  Are there other ways to implement this?

On Thursday, October 6, 2016 at 11:24:00 AM UTC-4, nk wrote:
Hello,
I have an application where each client is using their own database but the Java app itself is shared between more than one client.  The database connection is determined by the URL the client used to access the app.

I'm using hazelcast to enable caching of certain mybatis mappers (<cache type="com.myproject.cache.LoggingHazelcastCache"/>).  
Now what would happen if the first client got results for the query and stored them in hazelcast cache where the data came from the 1st client's DB.
Now the second client is executing the same query and looking up the query results in cache.  Would he pick up what is already stored there from the 1st client's DB?
Is there a way to mark each cache entry with the client's/tenant's name?  Would this multi-tenant paradigm even work with hazelcast cache via mybatis the way we have it setup?
What is the best way to approach this problem?  Ultimately, each tenant should have his own cache but i'm not sure it's possible to specify that via mybatis mappers.

Thank you very much for your help.
NK

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Loading...