Wordpress multisite with different databases
How did I get to multisite? The thing is that if you create some more complex functionality on the engine using plug-ins, which will include the capabilities of several diverse sites at once, its performance will be terrible.
Everywhere they add their js / css to where they are not needed. Thus, if you install several powerful heavy plugins and another + 10-15 additional smaller ones, you can see a huge number of scripts and styles everywhere, on almost every page.
There was a solution to this - multisite mode .
Connecting it is not difficult and you can start using it in a couple of minutes.
To do this, add a line to wp-config.php
Then go to Tools -> Network Installation.
It must be done with plugins turned off.

You will be prompted to replace the data in wp-config and .htaccess and log in again on the site.
There are only 2 modes of the site - these are either folders / or subdomains.
site.ru / site2
site2.site.ru
One table of common users - when registering at any of them, they will be able to log in to all the others in the same way, so you won’t have to register several times.
Manage plugins and themes for all sites from the panel. You can add the necessary for everyone in one place and then activate them only on those where they are needed separately. It is also possible to activate them immediately for the entire network.
Thus, it is possible to reduce plug-in consumption by 50% or more. Everything seems to be fine, everything is fine with the front-end, but the trouble is:

multisite uses one database for all sites - creating separate tables for each of them.
wp_
wp_2
wp_3
Now one base will increase several times from each new site.
For this, we will use the multi-db plugin . Of course, there are others, such as HyperDB, SharDB, but I did not find any information about them. You can download multi-db from any link below.
cloud.mail.ru/public/KMNr/WDpoUeyUV
drive.google.com/open?id=0Bw4XcI3lCfQSUWZWLUUyUHZFVTA
He himself suggests first determining how many bases you need (16, 256, 4096).
I'll start with 16. The sequence is important. Install multisite first, I will start to separate the databases, having 3 sites created - in order to test its operation after that.
This option allows you to host a specific site in a specific database. I don’t need her. I will not touch her. It makes no difference to me in which, most importantly - in any other, and not in one.
Run this sql query and then you will see them.

Since I'm at Localhoste, I don't need this. Root is suitable, but you may need to create new names and passwords, as well as give the necessary privileges if you are creating a site not for yourself alone, but, for example, for several people. Therefore, I will skip this point.
db-config.php, db.php should be placed in wp-content
move-blogs.php in any folder after wp-content, for example, in the new / wp-content / scripts /
DB-config.php
Here you need to specify the number of databases, 16 in this case, and ip server. At the end, instead of the last digits, the point 127.0.0 is put.
Next, in the first place, add the global table add_global_table ('dbname_global');
After that, it will remain to set the login and password for entering mysql below:
login root, password 1. Also here you need to specify these names that we registered at the beginning: dbname_0, dbname_1 ...
This is the most important part. The output of various errors is also formed here.
$ dbname = "multi"; // multi is the name of my shared database that I want to split into pieces, I need to write without the prefix
$ blog_table_prefix = 'wp_'; // this is a prefix in the common base
$ newdb_prefix = 'dbname_'; // new name
Login, server and password, as well as the number of databases.
$ dbhost = 'localhost';
$ dbuname = 'root';
$ dbpass = '1';
$ db_scaling = '16';
Now it is necessary to go to the address: localhost / the wp-content / scripts directory / the move-blogs.php

We press the Click found here .
We are waiting for the process to end, the link in the address bar should change. After that, click here to refresh the page. Status updated.

Now it’s clear that one global base has been created that contains wp_users, etc.

In addition to the main site, the remaining two sites were scattered on other bases in a random order, for example, the second site was in dbname_c, and the third in dbname_e.


Now you need to check what happened. You can try, for example, to record a post in several sites and check where they will be displayed. Indeed, records are appearing in new and global ones.


Nothing is added to the old “multi”. Then, probably, that’s all. So far, these are only the first opinions on this system; it is too early to draw conclusions.
The first is the inability to set roles for newly registered members. But there is a plugin for this . In addition, imagine a situation, you have two sites - site 1 (main) and site 2. A person is registered on site 2 and he can now log in and display on site 1, but you can’t see it from the console of site 1, despite the fact what he is. You can see it either on the public network or on site 2, from which he registered.
If you want to register through wp-login, wp-admin, wp-register from site 2, then you will be transferred to site 1. As the developers of multisite say, this is logical, since the account is created one for the entire network. But it can be inconvenient and not at all what you need. WooCommerce with its My Account page and shortcode [woocommerce_my_account] will help with normal registration, you can also use Login With Ajax.
Ps It turns out that you can easily combine styles / scripts with plugins and include them only on certain pages. Multi-db is laid out on the github, I did not immediately see it.
premium.wpmudev.org/forums/topic/multi-db-plugin-conlict-with-woocomerce
premium.wpmudev.org/forums/topic/db-error-could-not-list-tables-1
github.com/wpmudev/ multi-db
premium.wpmudev.org/forums/topic/re-multi-db-plugin
maxtop.org/wordpress-otklyuchenie-skriptov
maxtop.org/wordpress-obedinenie-css-fajlov-stilej-otklyuchenie-zagruzki-lishnix-css -fajlov
bavatuesdays.com/wpmu-multi-db-tutorial
www.inmotionhosting.com/support/website/wordpress/heartbeat-ajax-php-usage
Maybe someone else will have the same questions.
In the literal sense, the consumption of plugins. Let's say you have one site that uses 20-30 plugins.
With multisite, you divide it into 2 pieces. Thus, each part of it uses individually 10-15 plugins. For example:
site.ru is a bulletin board or catalog
site.ru / shop / or shop.site.ru is a store inside site.ru
site.ru uses one 10-15 plugins
site.ru / shop / uses another 10-15 plugins
At the same time, you do not need to worry about users and the admin panel, since you manage these sites through the same admin panel and the users are also common.
This is the number of databases allowed in the plugin. If you have a million sites on the multisite network - then they will fill up evenly on these bases, in which case it would be better to choose 4096 of course. For this, read the wp-forums. I have not tested a million sites.
But without this plugin, all these one million sites will be contained in one single database.
The answer is above. You need to initially figure out how much you need them, depending on the number of sites. Using multi-db is a step in optimizing the database for those who already have a lot of sites in multisite mode.
In order to save js / css to cut the base - there is no logic. The database section is already the second stage after optimizing js / css. He has nothing to do with them.
When there are a lot of plugins on the site (considering what else in the site itself, there are a lot of templates) then the question arises of how to distinguish all this for different parts of the site. A large number of them have a bad effect on the admin panel; it starts to slow down.
Multisite and without cutting the base solves the issue of the plugins themselves so that there are fewer of them on each site or piece of the site.
Since the multi-db plugin itself is decommissioned and not supported - there is still another, the best solution and convenient is SharDB
Working with it is much easier than multi-db. And after a more thorough check, I found that multi-db is buggy with some plugins, and this shar-db does not cause any problems with them.
First, you need to unzip the db-settings.php file to the root of the site so that wp-config.php is on the same level with it and connect it to it
Its settings
set is the name of the database that contains all the sites.
Next, copy the shardb-admin.php file to the plugins folder, as usual, activate this plugin for the network.
Then in the admin panel go to the plugin settings. Network Management ---> Settings ---> SharDB Migration.

And here the first step is Migrate Global Tables. He will offer to write it in a separate table - in setglobal

Next, the first site

If the database was called “set” then he suggests moving it to sethome

Everything is copied normally, you can copy further all sites, “Migrate Sites”

And so on ... numbering sites and their tables are displayed on the screen. The names of the tables the plugin wants to write to are also visible.

After everything is in place, you need to unzip the filedb.php to the wp-content folder
Now in the admin panel you can see the status of those sites that I did not copy for example, the desired tables with new names for each of them are also visible there.

Connection failed - this message displays db.php. If you have this file in wp-content, by default it tries to connect to different databases separately, and not to one common one. If you transfer all other sites on the same principle, then they will also work.
To copy the databases you should not have the db.php file, otherwise the settings item in the admin panel (SharDB Migration) will not be available, after copying you need to download it last. It serves merely as a link.
When creating a new sub-site, you need to delete the db.php file for this time or rename it and then, if desired, separate it into another database using the same method.
This measure may not matter to you if you have few sites. But the base of the engine itself has the ability to clog over time, and slow down the response from the site. If this happens for one site and one base, then having multisite mode it will be in tenfold + size since all these site tables will be in one place.
This is another feature of the engine that in some cases can be used.
The second method with shardb is more preferable, added below
Everywhere they add their js / css to where they are not needed. Thus, if you install several powerful heavy plugins and another + 10-15 additional smaller ones, you can see a huge number of scripts and styles everywhere, on almost every page.
There was a solution to this - multisite mode .
Connecting it is not difficult and you can start using it in a couple of minutes.
To do this, add a line to wp-config.php
/* Это всё, дальше не редактируем. Успехов! */
define('WP_ALLOW_MULTISITE', true);
Then go to Tools -> Network Installation.
It must be done with plugins turned off.

You will be prompted to replace the data in wp-config and .htaccess and log in again on the site.
Multisite system
There are only 2 modes of the site - these are either folders / or subdomains.
site.ru / site2
site2.site.ru
One table of common users - when registering at any of them, they will be able to log in to all the others in the same way, so you won’t have to register several times.
Manage plugins and themes for all sites from the panel. You can add the necessary for everyone in one place and then activate them only on those where they are needed separately. It is also possible to activate them immediately for the entire network.
Thus, it is possible to reduce plug-in consumption by 50% or more. Everything seems to be fine, everything is fine with the front-end, but the trouble is:

multisite uses one database for all sites - creating separate tables for each of them.
wp_
wp_2
wp_3
Now one base will increase several times from each new site.
Multisite with a separate database for each site
For this, we will use the multi-db plugin . Of course, there are others, such as HyperDB, SharDB, but I did not find any information about them. You can download multi-db from any link below.
cloud.mail.ru/public/KMNr/WDpoUeyUV
drive.google.com/open?id=0Bw4XcI3lCfQSUWZWLUUyUHZFVTA
He himself suggests first determining how many bases you need (16, 256, 4096).
I'll start with 16. The sequence is important. Install multisite first, I will start to separate the databases, having 3 sites created - in order to test its operation after that.
Creating vip databases
This option allows you to host a specific site in a specific database. I don’t need her. I will not touch her. It makes no difference to me in which, most importantly - in any other, and not in one.
The first step is to prepare new bases
CREATE DATABASE `dbname_0` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE DATABASE `dbname_1` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE DATABASE `dbname_2` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE DATABASE `dbname_3` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE DATABASE `dbname_4` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE DATABASE `dbname_5` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE DATABASE `dbname_6` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE DATABASE `dbname_7` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE DATABASE `dbname_8` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE DATABASE `dbname_9` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE DATABASE `dbname_a` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE DATABASE `dbname_b` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE DATABASE `dbname_c` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE DATABASE `dbname_d` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE DATABASE `dbname_e` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE DATABASE `dbname_f` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE DATABASE `dbname_global` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
Run this sql query and then you will see them.

Creating Users and Passwords in PhpMyAdmin
Since I'm at Localhoste, I don't need this. Root is suitable, but you may need to create new names and passwords, as well as give the necessary privileges if you are creating a site not for yourself alone, but, for example, for several people. Therefore, I will skip this point.
Unpacking files
db-config.php, db.php should be placed in wp-content
move-blogs.php in any folder after wp-content, for example, in the new / wp-content / scripts /
Configure Plugins
DB-config.php
define ('DB_SCALING', '16');
//------------------------------------------------------------------------//
//---DC IPs---------------------------------------------------------------//
//------------------------------------------------------------------------//
// Usage: add_dc_ip(IP, DC)
// EX: add_dc_ip('123.123.123.', 'dc1');
add_dc_ip('127.0.0.', 'dc1');
Here you need to specify the number of databases, 16 in this case, and ip server. At the end, instead of the last digits, the point 127.0.0 is put.
Next, in the first place, add the global table add_global_table ('dbname_global');
//------------------------------------------------------------------------//
//---Global Tables--------------------------------------------------------//
//------------------------------------------------------------------------//
// Do not include default global tables
// Leave off base prefix (eg: wp_)
// You don't really have to register these, they will work fine without.
// However registering at least your busiest ones might shave a few milliseconds off by avoiding some regexes.
//
// Usage: add_global_table(TABLE_NAME)
// EX: add_global_table('something');
add_global_table('dbname_global');
add_global_table('affiliatedata');
add_global_table('affiliatereferrers');
add_global_table('am_actions');
add_global_table('am_queue');
add_global_table('am_schedule');
add_global_table('autoblog');
add_global_table('bp_activity');
add_global_table('bp_activity_meta');
add_global_table('bp_friends');
add_global_table('bp_groups');
add_global_table('bp_groups_groupmeta');
add_global_table('bp_groups_members');
add_global_table('bp_messages_messages');
add_global_table('bp_messages_notices');
add_global_table('bp_messages_recipients');
add_global_table('bp_notifications');
add_global_table('bp_user_blogs');
add_global_table('bp_user_blogs_blogmeta');
add_global_table('bp_xprofile_data');
add_global_table('bp_xprofile_fields');
add_global_table('bp_xprofile_groups');
add_global_table('domain_mapping');
After that, it will remain to set the login and password for entering mysql below:
//------------------------------------------------------------------------//
//---DB Servers-----------------------------------------------------------//
//------------------------------------------------------------------------//
// Database servers grouped by dataset.
// R can be 0 (no reads) or a positive integer indicating the order
// in which to attempt communication (all locals, then all remotes)
//
// Usage: add_db_server(DS, DC, READ, WRITE, HOST, LAN_HOST, NAME, USER, PASS)
// EX: add_db_server('global', 'dc1', 1, 1,'global.mysql.example.com:3509','global.mysql.example.lan:3509', 'global-db', 'globaluser', 'globalpassword');
//
// Note: you can also place this section in a file called db-list.php in wp-content
// EX: add_db_server('global', 'dc1', 1, 1,'global.mysql.example.com:3509','global.mysql.example.lan:3509', 'global-db', 'globaluser', 'globalpassword');
add_db_server('global', 'dc1', 1, 1,'localhost','localhost', 'dbname_global', 'root', '1');
add_db_server('0', 'dc1', 1, 1,'localhost','localhost', 'dbname_0', 'root', '1');
add_db_server('1', 'dc1', 1, 1,'localhost','localhost', 'dbname_1', 'root', '1');
add_db_server('2', 'dc1', 1, 1,'localhost','localhost', 'dbname_2', 'root', '1');
add_db_server('3', 'dc1', 1, 1,'localhost','localhost', 'dbname_3', 'root', '1');
add_db_server('4', 'dc1', 1, 1,'localhost','localhost', 'dbname_4', 'root', '1');
add_db_server('5', 'dc1', 1, 1,'localhost','localhost', 'dbname_5', 'root', '1');
add_db_server('6', 'dc1', 1, 1,'localhost','localhost', 'dbname_6', 'root', '1');
add_db_server('7', 'dc1', 1, 1,'localhost','localhost', 'dbname_7', 'root', '1');
add_db_server('8', 'dc1', 1, 1,'localhost','localhost', 'dbname_8', 'root', '1');
add_db_server('9', 'dc1', 1, 1,'localhost','localhost', 'dbname_9', 'root', '1');
add_db_server('a', 'dc1', 1, 1,'localhost','localhost', 'dbname_a', 'root', '1');
add_db_server('b', 'dc1', 1, 1,'localhost','localhost', 'dbname_b', 'root', '1');
add_db_server('c', 'dc1', 1, 1,'localhost','localhost', 'dbname_c', 'root', '1');
add_db_server('d', 'dc1', 1, 1,'localhost','localhost', 'dbname_d', 'root', '1');
add_db_server('e', 'dc1', 1, 1,'localhost','localhost', 'dbname_e', 'root', '1');
add_db_server('f', 'dc1', 1, 1,'localhost','localhost', 'dbname_f', 'root', '1');
login root, password 1. Also here you need to specify these names that we registered at the beginning: dbname_0, dbname_1 ...
Configure move-blogs.php
This is the most important part. The output of various errors is also formed here.
$dbname = "multi"; //This is your current database
$blog_table_prefix = 'wp_'; //Prefix of your wpmu blog tables, most likely this won't need to be changed
$newdb_prefix = 'dbname_'; //This is the prefix of the db's you're moving your tables into - we assume they are all the same, if not, you're in trouble
//We need info to connect to the databases
$dbhost = 'localhost';
$dbuname = 'root';
$dbpass = '1';
//How many db's are you moving into (16, 256, or 4096)?
$db_scaling = '16';
$ dbname = "multi"; // multi is the name of my shared database that I want to split into pieces, I need to write without the prefix
$ blog_table_prefix = 'wp_'; // this is a prefix in the common base
$ newdb_prefix = 'dbname_'; // new name
Login, server and password, as well as the number of databases.
$ dbhost = 'localhost';
$ dbuname = 'root';
$ dbpass = '1';
$ db_scaling = '16';
Now it is necessary to go to the address: localhost / the wp-content / scripts directory / the move-blogs.php

We press the Click found here .
We are waiting for the process to end, the link in the address bar should change. After that, click here to refresh the page. Status updated.

Now it’s clear that one global base has been created that contains wp_users, etc.

In addition to the main site, the remaining two sites were scattered on other bases in a random order, for example, the second site was in dbname_c, and the third in dbname_e.


Now you need to check what happened. You can try, for example, to record a post in several sites and check where they will be displayed. Indeed, records are appearing in new and global ones.


Nothing is added to the old “multi”. Then, probably, that’s all. So far, these are only the first opinions on this system; it is too early to draw conclusions.
Nuances of multisite
The first is the inability to set roles for newly registered members. But there is a plugin for this . In addition, imagine a situation, you have two sites - site 1 (main) and site 2. A person is registered on site 2 and he can now log in and display on site 1, but you can’t see it from the console of site 1, despite the fact what he is. You can see it either on the public network or on site 2, from which he registered.
Registration redirect
If you want to register through wp-login, wp-admin, wp-register from site 2, then you will be transferred to site 1. As the developers of multisite say, this is logical, since the account is created one for the entire network. But it can be inconvenient and not at all what you need. WooCommerce with its My Account page and shortcode [woocommerce_my_account] will help with normal registration, you can also use Login With Ajax.
More on the topic
Ps It turns out that you can easily combine styles / scripts with plugins and include them only on certain pages. Multi-db is laid out on the github, I did not immediately see it.
premium.wpmudev.org/forums/topic/multi-db-plugin-conlict-with-woocomerce
premium.wpmudev.org/forums/topic/db-error-could-not-list-tables-1
github.com/wpmudev/ multi-db
premium.wpmudev.org/forums/topic/re-multi-db-plugin
maxtop.org/wordpress-otklyuchenie-skriptov
maxtop.org/wordpress-obedinenie-css-fajlov-stilej-otklyuchenie-zagruzki-lishnix-css -fajlov
bavatuesdays.com/wpmu-multi-db-tutorial
www.inmotionhosting.com/support/website/wordpress/heartbeat-ajax-php-usage
Answers on questions
Maybe someone else will have the same questions.
Does consumption mean space consumption? Why only 50%?
In the literal sense, the consumption of plugins. Let's say you have one site that uses 20-30 plugins.
With multisite, you divide it into 2 pieces. Thus, each part of it uses individually 10-15 plugins. For example:
site.ru is a bulletin board or catalog
site.ru / shop / or shop.site.ru is a store inside site.ru
site.ru uses one 10-15 plugins
site.ru / shop / uses another 10-15 plugins
At the same time, you do not need to worry about users and the admin panel, since you manage these sites through the same admin panel and the users are also common.
(16, 256, 4096) Bullshit.
This is the number of databases allowed in the plugin. If you have a million sites on the multisite network - then they will fill up evenly on these bases, in which case it would be better to choose 4096 of course. For this, read the wp-forums. I have not tested a million sites.
But without this plugin, all these one million sites will be contained in one single database.
define ('DB_SCALING', '16'); - And if then there will be 32 bases, then everything will go? :)
The answer is above. You need to initially figure out how much you need them, depending on the number of sites. Using multi-db is a step in optimizing the database for those who already have a lot of sites in multisite mode.
We saved on css / js, and took the cut base. I do not see the logic. :)
In order to save js / css to cut the base - there is no logic. The database section is already the second stage after optimizing js / css. He has nothing to do with them.
When there are a lot of plugins on the site (considering what else in the site itself, there are a lot of templates) then the question arises of how to distinguish all this for different parts of the site. A large number of them have a bad effect on the admin panel; it starts to slow down.
Multisite and without cutting the base solves the issue of the plugins themselves so that there are fewer of them on each site or piece of the site.
Better way
Since the multi-db plugin itself is decommissioned and not supported - there is still another, the best solution and convenient is SharDB
Working with it is much easier than multi-db. And after a more thorough check, I found that multi-db is buggy with some plugins, and this shar-db does not cause any problems with them.
First, you need to unzip the db-settings.php file to the root of the site so that wp-config.php is on the same level with it and connect it to it
/* Это всё, дальше не редактируем. Успехов! */
...
...
...
...
...
...
require_once('db-settings.php');
Its settings
// If you have multiple datacenters you can come up with your own datacenter
// detection logic (php_uname?). This helps ensure the web servers try to
// connect to the nearest database servers first, then distant ones.
define( 'DATACENTER', '' );
function add_slave($read, $host, $lhost = '', $user = DB_USER, $password = DB_PASSWORD) {
global $slaves;
$slaves[] = compact('read', 'host', 'lhost', 'user', 'password');
}
/* Add your configuration here */
// how many characters of hexidecimal hash
$shardb_hash_length = 2;
// what is the prefix of your blog database shards (everything before the hexidecimal hash)
// Название вашей базы
$shardb_prefix = 'set';
// set a string to be used as an internal identifier for the dataset
$shardb_dataset = 'abc';
// do you want to put your primary blog (blog_id 1) in its own 'home' database?
$enable_home_db = true;
// how many, if any, VIP databases do you have?
$num_vipdbs = 5;
// add this to set the write master read priority (default 1)
$shardb_master_read = 99;
// add this if all of your databases are on a local server
// Добавить это, если все ваши базы находятся на локальном сервере
$shardb_local_db = true;
// use this function to add a read slave host
add_slave($read_priority, $hostname, $local_hostname, $user, $password);
// instructions for adding vip blogs at the bottom of this confg filei
/* That's all, stop editing! Happy blogging. */
set is the name of the database that contains all the sites.
Next, copy the shardb-admin.php file to the plugins folder, as usual, activate this plugin for the network.
Then in the admin panel go to the plugin settings. Network Management ---> Settings ---> SharDB Migration.

And here the first step is Migrate Global Tables. He will offer to write it in a separate table - in setglobal

Next, the first site

If the database was called “set” then he suggests moving it to sethome

Everything is copied normally, you can copy further all sites, “Migrate Sites”

And so on ... numbering sites and their tables are displayed on the screen. The names of the tables the plugin wants to write to are also visible.

After everything is in place, you need to unzip the filedb.php to the wp-content folder
Now in the admin panel you can see the status of those sites that I did not copy for example, the desired tables with new names for each of them are also visible there.

Connection failed - this message displays db.php. If you have this file in wp-content, by default it tries to connect to different databases separately, and not to one common one. If you transfer all other sites on the same principle, then they will also work.
To copy the databases you should not have the db.php file, otherwise the settings item in the admin panel (SharDB Migration) will not be available, after copying you need to download it last. It serves merely as a link.
When creating a new sub-site, you need to delete the db.php file for this time or rename it and then, if desired, separate it into another database using the same method.
This measure may not matter to you if you have few sites. But the base of the engine itself has the ability to clog over time, and slow down the response from the site. If this happens for one site and one base, then having multisite mode it will be in tenfold + size since all these site tables will be in one place.
This is another feature of the engine that in some cases can be used.