Page 1 of 1

Speed: several DBs; 1 DB-several tables...?

Posted: Thu Apr 17, 2003 1:40 pm
by Gath
I looked in the MySQL docs, but could find. If i was only blind, please excuse me, and if possible, point me to the right direction... :)


What would be faster?
Using only 1 db, with several tables, or using several db, with less tables in each?

Now i have like this:
db - users
db - forum
db - info
db - stuff

That could all be put in the same db. But i divided it cause the users db is only used on login, the forum only in the forum, and so on...

Any ideas?

Thank you :)

Posted: Thu Apr 17, 2003 1:48 pm
by daven
It depends upon table interaction. If the forum tables never talk to the user tables, it would be good theory to have them in separate DBs. If, however, they communicate, they should be in the same DB.

I am not aware of any speed issues between the two schemes, but compartmentilizing stuff is a good idea

Posted: Thu Apr 17, 2003 2:28 pm
by McGruff
Not sure about the speed issues. Personally I would probably use a single database for these items - one of the reasons being that I'd normally be writing a php application to be compatible with the widest range of server setups, including some shared hosting accounts where the user only has a single database.

Another way to look at it is from the point of view of database permissions. The general rule is that you only give ordinary users the minimum permissions they require. Separate databases might make it easier to set up permissions - depending on your needs. You can also set permissions at the table level of course, within a single database. Not really giving you a definitive answer here - just something you can look at.