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

Steve Ebersole steve at hibernate.org
Tue May 15 13:04:39 EDT 2012

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".

steve at hibernate.org

More information about the hibernate-dev mailing list