Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 Database Design for Large no of Records

Author  Topic 

shenulal
Starting Member

11 Posts

Posted - 2012-07-21 : 02:59:53
Hi all,
I have an application which works in SaaS model. In that one large number of clients are there and each client have min 1 million record/ month and they can keep their historical data for min 3 months. So, please give me the best option to design this database. I had some few ideas like;
1. Keeping seperate database for each client. (not good i think)
2. Keep seperate table for each client (also not good practice, i think)

Please suggest me your openion

regards,
Shenu lal

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-07-21 : 03:07:25
I don't like either idea. Put them all in one database and all in one table, use a customer id/key to differentiate them. Add in table partitioning so that you can easily purge data and also for performance reasons.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-07-21 : 03:07:49
Also, what do you consider a large table?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

shenulal
Starting Member

11 Posts

Posted - 2012-07-21 : 04:46:14
Hi Tara Kizer,
Thank you very much for your suggestion.
It's actually for each transaction for each user for a particular client; this problem arouse. I'll explain you my current design

As

ID PK
UserID FK for the user transaction
TransTime datetime
etc...

In this situation with the TransTime i have to use some processing and the clients shall be taking the report for particular interval.
While, doing the table partitioning shall i want to do the partition based on UserID or using TransTime?

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-07-22 : 23:50:14
I would do it on TransTime, especially if you will be purging data based upon time.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -