Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Design a database with standarized and non standarized data coming from multiple clients SQL Server2008 R2

Posted on 2011-09-13
3
Medium Priority
?
366 Views
Last Modified: 2012-05-12


Hi,

I have a situation where I am tasked with my team to deveop a database for extranet sites which would represent multiple clients data. Now, important thing is there are two parts of incoming data from clients as follows;

1. Standarized Data: Which is common accross all existing and upcoming clients.
2. Client Specific Data: It varies client to client and contains client specific data columns.

Now, when designing database how to cater these two requirements;

1. Should I create new database for every client's extranet database in SQL Server 2008 R2 ?
2. OR  Should I create only one common database to hold all clients data?

If I create only one database to store all clients data including standarized data and non standarized data then how this would be managed?
e.g.,

tbl_StandarizedAndNonStandarizedData

ID,Name,Description,Code,City,client1customfield1,client1customfield2,client2customfield1,client3customfield1,client3customfield2,client3customfield3, ............ so on......

Can you please help me identify pros and cons of both type of implementations of database (means one database or new database for every new client)

Please let me know if you require further information.

Your comments and suggestions are greatly appreciated to solve this design issue.


Thanks.


0
Comment
Question by:ezkhan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 35

Expert Comment

by:ste5an
ID: 36535509
Store data always normalized, even it is not standardized, what ever your standards are.

ID,Name,Description,Code,City,client1customfield1,client1customfield2,client2customfield1,client3customfield1

Open in new window


This is an absolute no go.

Storing the data per client makes in many cases sense as it allows you easily to inspect it or track down data issues per client. But this must not be an extra database per client, it can be a single staging table per client or even a folder where you store the raw data. Depending on the number of clients and the amount of data you can also consider using one extra database where you store the clients data before you import it into your main system, e.g. separated by schema.

0
 
LVL 22

Accepted Solution

by:
8080_Diver earned 2000 total points
ID: 36536426
The "correct" answer to this can actually be either of the 2 choices that you outlined, obviously, so it is going to depend on how you want to approach it.  That being said, let me see if I can outline some considerations for each alternative:

Unified Database:
In this option, you would have all common data in single tables, e.g. if every client has a ClientInformation record you would have a ClientInformation table that could cantain all of the common columns for the ClientInformation records.
If, for instance, your Clients have some Product record data in common but some (or every) Clients have unique Product data then you would need to have separate tables, one for each Client with their unique columns and a Foreign Key (containing the Primary Key from the CommonProduct table) linking the data back to the CommonProducts table.
It should be noted that this approach will significantly complicate your application's code.

Separate Databases:
Essentially, this simplifies the application by having separate sets of tables that conform exactly to the requirements of the each CLient.
However, this also complicates the application because, while it may not have to "know" when to include an auxiliary table because a Client has some unique aspects to a given table, it does have to "know" which client it will be working with.

Observaton/Suggestion:
Having been a developer in the past, I can sympathize with those who will be having to develop the application so that it handles the needs of all clients, including those with unique data.  However, if you opt for the unified database approach, this can be mitigated, to some degree, by assigning each Client a Schema (which may include the dbo Schema for the Clients that have a "plain vanilla" set up).  Once that is done, you could provide Stored Procedures within each Schema and use them to access the data.  You would only have to Schema specific Stored Procedures for accessing tables that may have Client specific auxiliary tables.  Using my previous example table names, you would have a dbo.usp_Fetch_Client_Information Stored Procedure for accessing the ClientInformation table; however, you would have both a dbo.usp_Fetch_Products and a Client1.usp_Fetch_Products Stored Procedure for accessing the CommonProducts and, where appropriate, Client1.AuxProducts tables (as a resultset from a query joining the two tables).  This would reduce your efforts, within the database, to creating the unique auxiliary tables within the Schemas and the corresponding unique Storoed Procedures.
0
 

Author Closing Comment

by:ezkhan
ID: 36556601
Thanks alot. This helps
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Your data is at risk. Probably more today that at any other time in history. There are simply more people with more access to the Web with bad intentions.
In this article, we’ll look at how to deploy ProxySQL.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question