Click to See Complete Forum and Search --> : multiple or single database?
svidgen
01-16-2008, 09:36 PM
Hello all, I'm hoping someone can give some some insight into a design decision I need to make. Suppose I have a set of applications (or web pages) which connect to a MySQL database server and use tables A and B. Occasionally, an application (or page) needs to perform actions or joins with both A and B. But, for the majority of the time, A and B are accessed individually, almost to the point where they're unrelated.
The question is, how closely related do these tables need to be to justify placing them in the same database? I've read several places that cross-database joins in MySQL are super fast. Or conversely, how unrelated do these tables need to be to justify splitting them apart into separate databases?
How might the answer to this question be if more tables are added to the scenario?
Thanks,
chazzy
01-16-2008, 10:52 PM
I've never heard that statement "cross-database joins in MySQL are super fast" before. I see no relationship between where an object resides and its performance when dealing with objects in other schemas.
In most DBMS, per database structure is based on disk space usage and memory usage.
svidgen
01-17-2008, 01:20 AM
I've never heard that statement "cross-database joins in MySQL are super fast" before.
Statements with such a meaning are out there. I can't say they're there word for word. But, the question isn't in regard to whether they're "fast." The question is in regard to relative speed.
I see no relationship between where an object resides and its performance when dealing with objects in other schemas.
Are you aware of any MySQL documentation I can refer to in order to verify?
In most DBMS, per database structure is based on disk space usage and memory usage.
Could you please elaborate?
mattyblah
01-17-2008, 01:54 AM
tables are stored on disk and (not sure about mysql) are relatively independent of the database they reside. so regardless of whether you cross databases, the performance should be practically identical, unless the databases reside on different physical disks.. On an aside, blog posts/forum posts should always be taken with a grain of salt. If you read something in a book, you better believe the person knows wtf they are talking about.
svidgen
01-17-2008, 01:15 PM
tables are stored on disk and (not sure about mysql) are relatively independent of the database they reside. so regardless of whether you cross databases, the performance should be practically identical, unless the databases reside on different physical disks..
That's the impression that I'm getting. I just want to verify that for performance purposes, it shouldn't really matter what databases my tables are located in, so long as they're on the same server. And conversely, I could use a single database to serve multiple, even unrelated, applications, and there would be no efficiency advantage in separating tables of each application into their own databases.
The impression that I'm getting is that the separation of tables into databases, for most popular DBMS's is merely (or at least mostly) for the sanity of the programmers in designing, maintaining, and assigning permissions. Is this correct? Or is there any evidence to the contrary?
(this is meant to neglect the obvious server load and bandwidth issues associated with running multiple applications on a single server.)
Thanks,