google-code-export / dataobjectsdotnet

Automatically exported from code.google.com/p/dataobjectsdotnet
0 stars 0 forks source link

Multitenancy extension #287

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
See http://en.wikipedia.org/wiki/Multitenancy

Ideally, multitenancy must be provided almost fully automatically, if a 
special module is loaded. This module must provide:

1. ITenant interface marking the tenant hierarchy.

2. [Global] attribute indicating the hierarchy or index must not be a 
subject of multitenancy. ITenant hierarchy is [Global] by default.

3. Any other hierarchy must be converted to tenant-bound, which implies:
- Tenant key will be "injected" to the beginning of its primary key
- Tenant key will be injected to the beginning of all its indexes except 
the ones for which this is explicitly disabled by [Global] attribute.

5. using (TenantScope.Open(currentTenant)) will activate tenant-bound 
operation mode for the Session. It ensures:
- Any instance creation call uses currentTenant.Key to derive full key
- Any query is executed with additional restriction on any tenant-bound 
type. It looks like (type.TenantKey==currentTenant.Key).

6. Multitenancy model builder must be implemented in extendable fashion to 
allow others to implement e.g. custom tenant-bound type detection.

Original issue reported on code.google.com by alex.yakunin on 13 Jul 2009 at 7:47

GoogleCodeExporter commented 9 years ago

Original comment by alex.yakunin on 13 Jul 2009 at 7:52

GoogleCodeExporter commented 9 years ago

Original comment by alexis.k...@gmail.com on 9 Feb 2010 at 2:01