Thursday, July 16, 2009

Multi-Tenant Systems (Mandantenfähigkeit)

I am currently searching for design patterns and good practices for developing multi-tenant systems.

The problem I try to solve is how to design a system so I do not have to add the tenant id to each and every method call.

The first resource I found was . This describes different approaches on how to design the data layer for multi-tenant systems. Basically you may choose between a database for each tenant, a schema for each tenant or a shared database with tenant ids stored in each table.

The second resource is a design pattern at which has a broader view on the topic and does not only discuss data but resources in general.

Accessing a resource is done using the following steps:

* Get the current users tenant
* Build a filter for the resource
* Get the resource using the filter

Of course this does not solve my parameter per method problem. But maybe it brings me a step closer.