Database Abstraction Layer for PHP

User Tools

Site Tools


This is an old revision of the document!

ADOdb Load Balancer


ADOdb Load Balancer is a standalone code library that can be integrated into an existing ADOdb code base, and provides the ability to automatically, or manually, force read/write and read-only code segments to run on specific servers. It is currently only available for MySQL database systems. In it's default configuration:

  • A Primary server is designated to run all read-write code within a transaction
  • A Secondary server is designated to run all other read requests

This allows a simple replication system, for example the MySQL replication service, to emulate a cluster configuration, and enhance the performance of the main server by delegating resource-intensive queries to a secondary server.

More complex configurations can be made, including features such as manual assignation of target servers as well as transactional assignation of servers and multiple primaries with a randomized connection pool when used in a cluster configuration.

The Load Balancer works by intercepting the requests made through ADOdb methods, such as execute() and getAssoc(), and based on the method and/or the SQL statement to be executed, assigning the execution of the statement to the appropriate server.

More Information


Basic MySql Implementation Implementing ADOdb Load Balancer against a MySql 2 server replication system

v5/loadbalancer/index.1492361977.txt.gz · Last modified: 2017/04/21 11:29 (external edit)