-3

I want to know how to provide customization to each tenant. I want to provide the facility to add new fields in each form a tenant wants with field name, data type etc. Now my question is how to design database tables for this type of scenario ? As I have thought we will have to give form id to each form and whenever a Tenant creates a new field in the form, a new row in the database table should be created which should have Tenant id, Form id, Field name, Data type etc....

Now please give me true solution friends.... I need the database table design solution for this immediately...

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
  • http://stackoverflow.com/questions/15683213/databse-architecture-single-db-vs-client-specific-db-for-building-enterprise-w/15697362#15697362 – techuser soma Jan 19 '14 at 14:53

1 Answers1

3

Using SQL, tenants can share a database cluster, a database, or a table. Terminology varies.

When tenants share a database cluster, each tenant has a private database. This is the easiest to customize, has the strongest isolation among tenants, and is the easiest to recover in a disaster.

When tenants share a database, each tenant gets a private schema. This is also pretty easy to customize, has somewhat less isolation among tenants, and is still relatively easy to recover in a disaster. Recovery for one tenant will probably affect the performance of all tenants, though.

When tenants share a table, each tenant gets some private rows, so to speak. This is very hard to customize at even a small scale, isolation among tenants is harder, and disaster recovery for a single tenant is really hard.

I think your best bet is one database per tenant or one schema per tenant. But you should be aware that expecting end users to be database designers is risky.

Mike Sherrill 'Cat Recall'
  • 91,602
  • 17
  • 122
  • 185