Use WordPress MultiSite (WPMS) with a remote database for each created site

By the time plugins are loaded, it’s too late to change databases.

You could add a series of switch/options in your wp-config.php

switch ( $ _SERVER['HTTP_HOST'] ) {
    case 'somedomain.com': 
        define('DB_NAME', 'zzzzzz');
        define('DB_USER', 'yyyyyyy');
        define('DB_PASSWORD', 'xxxxxx');
        define('DB_HOST', 'localhost');
        break;
    case 'anotherdomain.com': 
        define('DB_NAME', 'aaaaaa');
        define('DB_USER', 'bbbbb');
        define('DB_PASSWORD', 'cccccc');
        define('DB_HOST', 'localhost');
        break;
}

But this would then not be a managed like a multisite, and you could have a lot of unexpected results because the database and files may not match (if one instance changes the files from what another instance is expecting)

I don’t think I’d want to try it.