Thursday, March 29, 2012

Distributed databases?

Hi everybody.

I have a question about the database performance.

Suppose we have 15 tables distributed to 3 databases. So if we want to to load some related data from diffrent tables of diffrent databases, we have to make more connections to the other databases, and it takes some time to establish the connection. but if we use 1 database with 15 tables, then we wont have this problem and we wont make more connections. but using 1 database, will grow the size of database file (*.mdf) and sure this couses to take more time of file operation like record-seek-time, record-insertion-time and etc.

which of these solutions have better performance? Distributed databases or single one?

Thanks

Even if you put them all in one database, you dont have to put them all in the same mdf file, or even on the same drive, and then even as the tables grow very large, you can partition them, which further helps the optimization.

The driving factor though, for me, is logical separation.

Are these tables all part of the same application? In this case I would put them in the same database. Are some of them shared between applications? In this case, I would put the shared tables in a database, and the application specific tables in another.|||Are you talking about "Databases" on the same server, or different servers?

Databases on the same server would not require multiple connections to be made for each database, you connect to the server, not the database.

|||

The main reason for having multiple databases on different machines would be if you are trying to scale out instead of scale up on a single server. Unless a single server cannot handle the workload, you probably don't need/want to scale out yet.

The size of the data file(s) in a single database does not have nearly as much impact on performance as other factors like having the proper indexes in place for your workload.

|||

Hi, thanks for the replyes.

I can seperate my data in 3 sets. first, the data which are stattic, like the list of countries, second, the memberships data of the members, like member's general information, membership information and etc. and third, the data of the members' posts.

the 1st set, is static, so never (or seldom) grows. but the 2nd and 3rd are dynamic and would grow alot.

data of 2nd and 3rd sets can be related, but also can not. I mean, as you know, the posts of the members are related to the members, but they are POSTS, so it may be logical to use a seperate database for them and a seperate database for members.

but from another view, they are related, they are the posts of the members! so it would be logical again, to put both the sets in one database.

and by this time, i'm going to use just one server, not many servers (may be in future).

and I dont know, putting all the data in one database, would reduce the performance of my database (and so my application) or not.

by the way, the data of the members, will be used by seperate applications, but the posts are for a single application. infact all of my applications will use the membership information, but the each of these, have their own application-specific data.

No comments:

Post a Comment