-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: MultiTenancy with OGM
PostPosted: Fri Apr 29, 2016 7:32 pm 
Newbie

Joined: Fri Apr 29, 2016 7:17 pm
Posts: 1
I am looking at options for supporting multitenancy with OGM. The path I am considering is to support isolation at the cache level, similar to a schema isolation.

It looks like to do this, I would need a sessionFactory per tenant so I can isolate the metadata mapping per tenant and get unique cache names per Entity/Tenant, ala TenantId-Product, TenantId-Category, etc.

Would there be problems in using multiple sessionFactories for the same provider? Is there some other pattern I should consider?

Thanks,
--Rob


Top
 Profile  
 
 Post subject: Re: MultiTenancy with OGM
PostPosted: Wed May 04, 2016 3:36 am 
Hibernate Team
Hibernate Team

Joined: Sat Jan 24, 2009 12:46 pm
Posts: 388
Hi,

Working with multiple factories should be fine, I suppose you'll have the burden of maintaining different (XML) mappings, though.

Hibernate ORM defines different means of multi-tenancy (see http://docs.jboss.org/hibernate/orm/5.1 ... ultitenacy) which essentially let you use the same mappings with a different database or schema per tenant.

I don't think that these options are supported yet in OGM, though. Could you try it out (probably you'd run into some JDBC-specific code paths) out and report back by creating a feature request in the OGM tracker (https://hibernate.atlassian.net/browse/OGM)?

It'll be an interesting exercise, as we currently work with a single DatastoreProvider instance (per session factory), whereas it would have to be one per tenant now.

Thanks,

--Gunnar

_________________
Visit my blog at http://musingsofaprogrammingaddict.blogspot.com/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.