ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:loadbalancer:mysql_replication:creating_connections

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revisionBoth sides next revision
v5:loadbalancer:mysql_replication:creating_connections [2016/05/30 17:01] – created mnewnhamv5:loadbalancer:mysql_replication:creating_connections [2017/04/21 11:50] – external edit 127.0.0.1
Line 2: Line 2:
 ~~NOTOC~~ ~~NOTOC~~
 ====== Creating A Connection Pool ====== ====== Creating A Connection Pool ======
 +Each of the connections in the connection pool are defined in the exact same way as a normal ADOdb connection, which makes it simple to add the functionality of existing code. This is shown below:
 +
 +^ Existing ADOdb Connection                                   ^ Load Balance                                                                                  ^
 +|                                                             | Instantiate Load Balancer as $db                                                              |
 +| Instantiate ADOdb as $db                                    | Instantiate ADOdb as $db0, designating the connection as the primary (read-write) connection  |
 +| Connect $db to database using normal connection parameters  | Connect $db0 to database using normal connection parameters                                   |
 +|                                                             | Add connection $db0 to connection pool $db                                                    |
 +|                                                             | Instantiate ADOdb as $db1, designating the connection as a secondary (read-only) connection   |
 +|                                                             | Add Connection $db1 to connection pool $db                                                    |
 +|                                                             | Repeat for available number of secondary servers                                              |
 +| Execute commands against connection $db                     | Execute commands against connection pool $db                                                  |
v5/loadbalancer/mysql_replication/creating_connections.txt · Last modified: 2017/04/28 02:09 by mnewnham