Separate DBs vs. One Big Shared DB? 13 Years, 6 Months ago
|
Karma: 0
|
Greetings,
For Edwin, and anyone with extensive experience with JMS Multisites - I have what I believe to be a simple question...
I am setting up a back-end only multisite environement - meaning, users won't be able to purchase or setup a new site on their own from the front-end. I will manage all of the new sites when a new client signs up.
From Edwin's tutorial, 0.b - page 24, I have established the Master site with all components, plugins, modules ...etc. (no configurations), and am creating the SLAVE1, which will act as the template for all new sites.
QUESTION:
Is it best to use separate databases for each master/slave? Or to share a single DB and use various table prefixes? I don't know if this even matters, but my brain tells me to setup a different DB for each new site as this would allow for easier troubleshooting of a specific site should the need arise.
EDIT: I should mention that I have no limitation as to the number of DBs I can create on my cPanel server.
Thanks,
--Kevin
|
|
|
Last Edit: 2011/06/20 22:40 By Gremlin.
|
|
Re: Separate DBs vs. One Big Shared DB? 13 Years, 6 Months ago
|
Karma: 54
|
Creating several website into a same DB is sometimes required when sharing extension content and that it is not possible to have a MySQL user that has the privileges across DB.
We also consider that there is a limitation on the number of website that you can put in a same DB. We consider the limit at 100 websites into the same DB.
The reason is related to MySQL performance.
Each MySQL table use 3 files on the disk.
A core Joomla use 39 tables. We can imagine that a normal website can have 150 tables or more depending on the number of extensions installed.
So the number of files in the same directory is (100 websites * 150 tables * 3 files) = 45,000 files. The operating system can become slower when it has more than 100,000 files into the same directory.
So to avoid using a too huge number of files into the same directory, it is better to have several DB and for example use 1 DB per website when this is possible.
Another problem when using a very large number of tables into the same DB is the configuration of MySQL to allow proceeding with backup of the DB.
During the backup of a DB, MySQL need to lock all the tables. So if you have a large number of tables into the same DB, you need to have a large enougth locking file and open file description in MySQL.
So using the same DB is generally used when there is MySQL priviliges issues and is sometime easier to setup.
|
|
|
Last Edit: 2011/06/21 09:38 By edwin2win.
|
|
Re: Separate DBs vs. One Big Shared DB? 13 Years, 6 Months ago
|
Karma: 0
|
Great reply - As each of my slaves will have data unique to that site, I will not be sharing content once the a new slave is created, so I will use a separate DB for each site.
Thanks,
--Kevin
|
|
|
|
|
|