Shared Drupal tables, but from a different database

I have a Drupal Multisite created with hundreds of sites. I want some tables to be separated (for example, banners and roles), so I do not need to update hundreds of sites when changing a banner (for example).

I know that this can be done using these lines in settings.php:

$db_url = 'mysql://user:pwd@localhost/example_db';

$db_prefix = array(
     'default'   => '',
     'users'     => 'subsite2_',
     'sessions'  => 'subsite2_',
     'authmap'   => 'subsite2_',
);

But ... what if I also have several databases? I have one database in which all shared tables are stored. Therefore, in this database I have a Banners table - I want all other sites to be used.

The reason for configuring the database multiple times is that the entire multi-node installation consists of hundreds of sites (and by the end of this year there will be thousands) .. therefore, each database contains only 20-40 sites. I suspect that many of these tables may be split.

hope someone can help. thanks!

Marco

+3
source share
3 answers

, - . , . , "" , ( ) , / , . someDatabase.someTable. , PostgreSQL. , , - , (AFAIK) Drupal.

"" /. , Drupal multisite, " " Drupal. , , concurrency.

+2

, , ( ):

  • Data:

    , . API . Drupal .

  • :

    :

    • Drupal Views 2.
    • , , .
    • , , , , ..
    • API - .
    • API Drupal ( ).
    • API - .
+1

mysql 5+, mysql - drupal. , . devbee mysql drupal. .

0

Source: https://habr.com/ru/post/1723011/


All Articles