computermax2328 Posted October 23, 2012 Share Posted October 23, 2012 Hello All, I was wondering what is the point of having multiple databases? Why not just have X amount of tables inside of one database? If you have multiple databases that means you have to open and close more than one database on one page. I am wondering this because I was thinking about putting all of my uploaded photos into their own database to make a more searchable and well structured database. Does it make it faster? Thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/269795-multiple-databases/ Share on other sites More sharing options...
vbnullchar Posted October 23, 2012 Share Posted October 23, 2012 saving photos in your database is a bad idea.. save it in your file system its much faster.. Quote Link to comment https://forums.phpfreaks.com/topic/269795-multiple-databases/#findComment-1387140 Share on other sites More sharing options...
computermax2328 Posted October 23, 2012 Author Share Posted October 23, 2012 I know that part. By store them in my database I mean store the file name and path in the database. Is there an advantage to using multiple databases regardless of the content inside the tables?? Quote Link to comment https://forums.phpfreaks.com/topic/269795-multiple-databases/#findComment-1387163 Share on other sites More sharing options...
Jessica Posted October 23, 2012 Share Posted October 23, 2012 Don't use multiple databases for one application. Each application should have it's own database. Quote Link to comment https://forums.phpfreaks.com/topic/269795-multiple-databases/#findComment-1387166 Share on other sites More sharing options...
shlumph Posted October 23, 2012 Share Posted October 23, 2012 There are times when you hit performance limits due to transaction volume, and would like to partition or shard your database. Search database sharding for more info, there's plenty out there. Quote Link to comment https://forums.phpfreaks.com/topic/269795-multiple-databases/#findComment-1387178 Share on other sites More sharing options...
shlumph Posted October 23, 2012 Share Posted October 23, 2012 Another reason to have multiple database is to set up a master/slave environment, where you do reads from the slave(s) and writes to the master. The slave(s) then get updated from the master every so often. Whether or not you'll get a performance boost depends on your application, if it's more write intensive, more read intensive, etc. Quote Link to comment https://forums.phpfreaks.com/topic/269795-multiple-databases/#findComment-1387180 Share on other sites More sharing options...
Psycho Posted October 23, 2012 Share Posted October 23, 2012 I'll add the following: First off, separating data into a separate "database" for the purposes of improving performance will likely have zero benefit (if not a degradation) if you just meant to put the data into a separate Database "instance". The term "database" is is vague because it can mean a physical database server, a database service/application, or a separate database instance on the same server/application. I doubt you are thinking about setting up a second physical (or virtual) database server and just creating another database instance on the same machine would still use the same processor, memory and other resources. Second, there are legitimate purposes for having separate database instances or even separate database servers. Separate database instances can be used to segregate information that has zero relational information. This makes it easy to manage the data in one database instance without worrying about the unrelated data. Or, the data may require specific handling that the other one doesn't. Putting data onto separate physical (or virtual) database server can be used for the purpose of creating scalability in the application. However, it would (probably) never be done with data that should relate between the two databases. But, more specific to your issue, why do you think putting the data related to your images into a separate database is needed to improve performance? Are you having a performance problem now? If so, I highly doubt that the data being in the same database is the issue. There could be many reasons for performance problems: bad DB design, bad coding practices, DB running on machine with too little resources, etc. Based upon prior experience on this board I would lean towards one (or both) of the first two problems. Quote Link to comment https://forums.phpfreaks.com/topic/269795-multiple-databases/#findComment-1387187 Share on other sites More sharing options...
computermax2328 Posted October 23, 2012 Author Share Posted October 23, 2012 No problems at all. I am in the process of creating a database map and I was just wondering if multiple databases would improve performance. I guess I was thinking along the lines of more computer processors means more power. I was thinking it was the same idea. Then again, both processors work at the same time to complete the same goal, so I guess not. Thanks guys! Quote Link to comment https://forums.phpfreaks.com/topic/269795-multiple-databases/#findComment-1387266 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.