I am developing a custom CRM solution which will be sold via the Web/SaaS model. I anticipate tens or hundreds of clients using this solution. I will be using MS SQL as the db engine.
Option 1 is to have a single DB, and include a TenantId column on tables, a suitable index and use ‘where tenantId={…}’ on each db access.
Option 2 is to have an individual DB for each client, avoiding the need for the TenantId and where clauses.
I anticipate that each client will have hundreds of thousands of records, not millions.
As I see it, there will be a total number of data pages whichever option I go for. The decision seems centered on whether SQL is better at managing multiple DBs, or a single DB with TenantId and index. Initially the solution will run on a single DB server, but will eventually move to SAN.
Does anyone have any views on this?
There is an interesting MSDN article, titled Multi-Tenant Data Architecture, which you may want to check out. The authors make a brief analysis on where a certain approach might be more appropriate than another:
Note that the “shared approach” is option 1, and the “isolated approach” is option 2, in your case. You are not biased on either side when it comes to the first two points, so I think I would base my decision on the last two points.