I want to setup 4 wikis ol, ml, ssip and v4v with the last 3 sharing the tables: 'user', 'user_groups', 'interwiki', 'ipblocks' of the first one: ol
I know that I can do this by using only one database for all 4 wikis and different table prefixes for each. However, I was hoping to be able to use 4 separate dbs so that I don't "put all my eggs in one basket", so to speak. My problem is that my host setup automatically assigns a different username to each db (as well as arbitrarily placing dbs on different db servers according to availability at the time of creation, but I can solved that by simply creating, deleting and creating again until I get them on the same db server). I can also change the passwords so that they are the same. So I was looking into the coding to see if I might be able to make a change to enable the shared situation even though the db usernames are all different. I found where the code in database.php where function tableName( $name ) adjusts the input variable (which is the concatenation of the simple tablename with the database name) to replace the database name with that of the shared one for those tables which are in the shared array - set in local settings. This all looks great, but it occurred to me, how can this work for table JOIN operations? Don't JOIN operations necessarily need to be relative to the same database?
Is there any working installation with shared tables on different databases so that it is known that this works? Given that it does (somehow?), why would it also not be possible to have different usernames for the different databases?
Do the experts here see any totally impossibility to me setting things so that for a shared table the username can be changed in addition to the database name (and perhaps even change the db server as well)? I am not asking directly how this would done (although such help would certainly be appreciated), since I am confident that if it can be done at all, then I can figure it out myself.
Another possibility that I have thought of (particularly if shared tables do not actually work on different databases, but only on different prefixed tables within one database, because of the join problem that I mentioned above) is to place the db parameters of all 4 dbs in the local settings of each (in an array of course) and then whenever a shared table is *written to* it will be written to on all 4 wiki databases. In this manner they will all be kept in sync. What do the experts here think of that idea, given that something easier and less modifying of the system code is not possible.
Thanks muchly in advance for any helpful ideas.
--Paul Wakfer
MoreLife for the rational - http://morelife.org Reality based tools for more life in quantity and quality The Self-Sovereign Individual Project - http://selfsip.org Self-sovereignty, rational pursuit of optimal lifetime happiness, individual responsibility, social preferencing & social contracting