Home All Groups Group Topic Archive Search About

Database with many tables or multiple databases with lesser tables

Author
28 Jul 2006 4:10 PM
Naveen
We are building a large application (a financial system) that, after
normalization, would approximately need 1500 or so tables. The question is
should we build this as one database or should we separate it out into
multiple databases.
There is a case for separating out into 5 or so databases based on
functional modules within the financial system (GL, AP, AR etc.) . Problem
though is they are related to one another in some way.
In a single database case, some standard tables (like U.S. States, Notes
etc.) can be a single table. Also it avoids cross database talks so ease of
development is more.
What are the performance advantages/disadvantages of one way or the other?
Does SQL Server performance get affected if the number of tables is large, as
in my case? Any inputs, suggestions?

Thanks
Naveen

Author
28 Jul 2006 5:48 PM
Tracy McKibben
Naveen wrote:
Show quote
> We are building a large application (a financial system) that, after
> normalization, would approximately need 1500 or so tables. The question is
> should we build this as one database or should we separate it out into
> multiple databases.
> There is a case for separating out into 5 or so databases based on
> functional modules within the financial system (GL, AP, AR etc.) . Problem
> though is they are related to one another in some way.
> In a single database case, some standard tables (like U.S. States, Notes
> etc.) can be a single table. Also it avoids cross database talks so ease of
> development is more.
> What are the performance advantages/disadvantages of one way or the other?
> Does SQL Server performance get affected if the number of tables is large, as
> in my case? Any inputs, suggestions?
>
> Thanks
> Naveen

Keep them in one database, there is nothing to be gained by splitting
them apart.  That said, you can create multiple filegroups within a
single database, and specific tables can be stored in specific
filegroups.  A common optimization tactic is to put high-traffic tables
into seperate filegroups that are isolated on seperate disk spindles,
which spreads the I/O across multiple hardware channels.


--
Tracy McKibben
MCDBA
http://www.realsqlguy.com
Author
29 Jul 2006 1:04 PM
Erland Sommarskog
Naveen (Nav***@discussions.microsoft.com) writes:
> We are building a large application (a financial system) that, after
> normalization, would approximately need 1500 or so tables. The question is
> should we build this as one database or should we separate it out into
> multiple databases.
> There is a case for separating out into 5 or so databases based on
> functional modules within the financial system (GL, AP, AR etc.) . Problem
> though is they are related to one another in some way.
> In a single database case, some standard tables (like U.S. States, Notes
> etc.) can be a single table. Also it avoids cross database talks so ease
> of development is more.
> What are the performance advantages/disadvantages of one way or the
> other? Does SQL Server performance get affected if the number of tables
> is large, as in my case? Any inputs, suggestions?

The number of tables has little do to with it. But if the database gets
huge, you may want to consider filegroups and that sort of thing.

Having separate databases only makes sense if one module has to be available
while another is down for maintenance.

What you could consider, though, if you are on SQL 2005 (and which you
should be if you are in the development stage now) is to use different
schemas for the various modules. This gives no performance benefits,
but can be an ease for development, as different components gets separate
name spaces.

--
Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Author
29 Jul 2006 4:35 PM
David Portas
Naveen wrote:
Show quote
> We are building a large application (a financial system) that, after
> normalization, would approximately need 1500 or so tables. The question is
> should we build this as one database or should we separate it out into
> multiple databases.
> There is a case for separating out into 5 or so databases based on
> functional modules within the financial system (GL, AP, AR etc.) . Problem
> though is they are related to one another in some way.
> In a single database case, some standard tables (like U.S. States, Notes
> etc.) can be a single table. Also it avoids cross database talks so ease of
> development is more.
> What are the performance advantages/disadvantages of one way or the other?
> Does SQL Server performance get affected if the number of tables is large, as
> in my case? Any inputs, suggestions?
>
> Thanks
> Naveen

Use multiple databases only if they will have different requirements
for availability, security or other admin-related reasons. There is no
performance advantage to be had from creating additional databases
(unless you put them on different servers).

I'm curious as to why you would bother creating your own GL, AP, AR
functionality if the task is as complex as you seem to suggest. Why
wouldn't you buy rather than build?

--
David Portas, SQL Server MVP

Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.

SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--
Author
31 Jul 2006 2:28 AM
--CELKO--
>> We are building a large application (a financial system) that, after normalization, would approximately need 1500 or so tables. <<

We have to take your word for it, but I have found that a bit larger
than most Fortune 500 systems.  But who cares, if the data model is
right.  And if they are part of the same data model, they should be in
one DB -- would put male employees in one schema and female employess
in a second schema?

With various products, you can partition the tables, do some indexing
tricks, etc. but that is implementation and not design.

>> The question is should we build this as one database or should we separate it out into
multiple databases. <<

Unh?  Is it one data model or many different universes of discourse?

>> There is a case for separating out into 5 or so databases based on functional modules within the financial system (GL, AP, AR etc.) . <<

"functional modules within the financial system"  -- Like a 1950's
COBOL system!  Nothing like an RDBMS at all!  No concept of a universe
of discourse at all.

>>  though is they are related to one another in some way. In a single database case, some standard tables (like U.S. States, Notes  etc.) can be a single table. <<

NO, THEY CANNOT!!  A table a set of entities or relationships of the
same kind.  Were the kid on dope in the back of my database class?
Look up the OTLT or MUCK design flaw.

>> Also it avoids cross database talks so ease of development is more. <<

Ease of developement is not the important thing.  Data quality,
maintainabilty and those other things they told you about in the
Software Engineering course you should have taken are ORDERS OF
MAGNITUDE more important (literally -- did you ever read Boehm's
research, etc.?).

AddThis Social Bookmark Button