BlueSkyIS Posted September 3, 2014 Share Posted September 3, 2014 Hello! I have five websites on a single server, and each website uses the same geographic data, for instance US zip codes and city/state latitudes and longitudes. Each website uses it's own copy of these "large" tables. I would like to avoid having to maintain the same data in 5 databases, but I am more concerned with database performance, e.g., the speed at which the data is retrieved for each website. Question: Should I set up a new separate database that contains the shared tables for all websites and allow each website to connect to this new database for shared data? Or is it better for each website have it's own copy of the duplicate tables? Thanks for any info! Cheers Link to comment https://forums.phpfreaks.com/topic/290828-opinion-multiple-websites-same-data-individual-dbs-or-single-db/ Share on other sites More sharing options...
requinix Posted September 3, 2014 Share Posted September 3, 2014 Shared. MySQL isn't going to look at your data and say "oh, this is the exact same as off in this other table" and then reuse results. That's your job, and by that I mean not having the same data in multiple tables. Link to comment https://forums.phpfreaks.com/topic/290828-opinion-multiple-websites-same-data-individual-dbs-or-single-db/#findComment-1489794 Share on other sites More sharing options...
BlueSkyIS Posted September 21, 2014 Author Share Posted September 21, 2014 Shared. MySQL isn't going to look at your data and say "oh, this is the exact same as off in this other table" and then reuse results. That's your job, and by that I mean not having the same data in multiple tables. Thanks for that info. I left out an important part of my question: While each of the websites uses the same geographic data (zip codes, city/state geocodes, etc.) each website has it's own version of data specific to that website. For instance, one site maintains a list of grow stores and has a table 'locations' that contains all of those locations. Another site maintains a list of motorsports shops with it's own, structurally different version of the table 'locations'. If each site has it's own db and also pulls from a shared db, two MySQL db connections would often be required instead of one. Is the processing cost of 2 PDO/MySQL connections substantial enough to warrant keeping multiple copies of the same data in multiple databases? Or is the cost of 2 db connections so insignificant that it makes sense for 4 or 5 sites to use a shared database AND have their own unique database? My concerns are 1. Additional processing required to use 2 database connections per site and 2. Possible delays due to multiple sites sharing the same database tables vs. each site using it's own copy. Thanks for your input! Link to comment https://forums.phpfreaks.com/topic/290828-opinion-multiple-websites-same-data-individual-dbs-or-single-db/#findComment-1491737 Share on other sites More sharing options...
CroNiX Posted September 22, 2014 Share Posted September 22, 2014 I have over 160 websites using the same codebase and same shared database. We get over 6M hits/month. No issues or "slowness". It comes down to query optimization and properly indexed fields. Link to comment https://forums.phpfreaks.com/topic/290828-opinion-multiple-websites-same-data-individual-dbs-or-single-db/#findComment-1491774 Share on other sites More sharing options...
BlueSkyIS Posted September 27, 2014 Author Share Posted September 27, 2014 Thank you very much! Link to comment https://forums.phpfreaks.com/topic/290828-opinion-multiple-websites-same-data-individual-dbs-or-single-db/#findComment-1492230 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.