We are looking to have the ability to run In-Portal website in Database Load Balanced environment. It's usually necessary for high load/availability websites.
The idea is to have MASTER/SLAVE(s) configuration. This will separate WRITE/READ database requests between 2+ servers (1 Master and 1+ Slaves replicated from Master).
- all Admin requests go to MASTER
- all Front READ requests go to SLAVE
- all Front WRITE requests go to MASTER
- all Front Search READ go to MASTER
To enable load balancing:
- add $_CONFIG['Database']['LoadBalancing'] = '1'; to /system/config.php file
create /system/db_servers.php file with following content:
only Slave Servers are listed in file above, since database server defined in /system/config.php is considered as Master Server for backwards compatibility.
See http://www.mediawiki.org/wiki/Manual:$wgDBservers for more details.
Most likely this functionality will be added to In-Portal 5.2.0, but has been tested on 5.1.3 Beta2 - so can be applied if needed.
Attaching patch developed by Alex and tested by myself on 1 Master and 3 Slave servers. Additional tests highly recommended and appreciated.