This repository has been archived by the owner on Mar 3, 2020. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Database Replication/Load Balancing
Initial database replication pull request for discussion and review. A few technical items to consider:
The implementation uses a master/master configuration versus a master/slave configuration due to incompatibilities with HHVM and mysqlnd.
The implementation supports Vagrant and direct provisioning only at this time. Vagrant users should utilize the included install_config.bat script to rebuild their vagrant configuration. Those provisioning directly can execute the provision script on the initial host and the replication script on the subsequent database servers.
When directly provisioning the user needs to supply the replication options and the server number for which they are deploying (starting from one, onwards). Vagrant will automatically handle this process based on the options provided to the install_config.bat script.
The install_config.bat file can be extended to include further configuration of the Vagrant options. Such options might include a different network subnet, alternative usernames, memory allocation, etc. Furthermore, this script can be duplicated as a bash file for Linux-based host systems.
The current implementation of Memcached provides significant optimization to the database queries and subsequent caching. Database replication is unlikely to provide benefit to typical users and should only be used for complex environments.
The settings.ini file will need to be updated to include the DB_MASTER and DB_SLAVE fields. DB_MASTER should be the primary server (web interface host), and DB_SLAVE should be your secondary MySQL server. Additionally the database username and password within settings.ini needs to be updated to the replicator account.