[hibernate-dev] Multi-Tenancy and "shared" data

Emmanuel Bernard emmanuel at hibernate.org
Mon May 21 12:33:45 EDT 2012



On 15 mai 2012, at 19:04, Steve Ebersole wrote:

> Multi-tenant setups sometimes have data that is shared between the 
> tenants (codec tables, etc).
> 
> I think the first question is do we want to support this mixing?  I 
> think it is common enough that it is worthwhile to support it.  And I do 
> not think it is complicated enough to be painful to implement.  As long 
> as we assume that there is some form of database-level availability 
> between shared, non-shared data (even for the DATABASE and SCHEMA 
> strategies) I think we will be fine.
> 
> Assuming we do support it, there is a decision we need to make about how 
> we differentiate shared (tenant aware) and non-shared (non-tenant aware) 
> data, especially important when we talk about the DISCRIMINATOR approach 
> which touches on a more general outstanding decision with regard to 
> supporting DISCRIMINATOR multi-tenancy.  Basically whether entities are 
> inclusively considered multi-tenant when the user has specified 
> DISCRIMINATOR, or whether we expect some form of annotation stating the 
> entity is multi-tenant.  Personally, I think the inclusive approach (all 
> entities are assumed multi-tenant) is probably the better approach.  In 
> which case we need an annotation to say "this entity is not multi-tenant".

I agree, the idea of an annotation to disable multi-tenancy on an entity assuming tenancy has been configured seems to be the safest.


More information about the hibernate-dev mailing list