dotConnect for MySQL Documentation
In This Topic
    Using MySQL Load Balancing
    In This Topic

    dotConnect for MySQL allows using load balancing with MySQL clusters. It allows you to specify several hosts (that must belong to the cluster you connect) with their ports in the Host parameter of the connection string, like "Host = (localhost:3307,db:3308,db)". If several hosts are specified, dotConnect for MySQL will switch to the next host in the list for each new SELECT or SHOW statement. The first host in the list is considered the master host. All statements other than SELECT and SHOW will be executed against it.

    Note: If the Port is also specified as the separate connection string parameter, this port value will be used as default for all hosts in the Host parameter with no port specified.

    In case of using LocalFailover if a connection lost, dotConnect for MySQL tries to implicitly reconnect and reexecute the operation. If load balancing is used, and the operation is SELECT or SHOW query execution, dotConnect for MySQL tries to reconnect to the next server in the list, not to the same one.

    If connection pooling is enabled when using load balancing, the pooling is used in usual way. When a connection to a specific host is closed, it is placed in the pool instead of closing, and when it is opened, if there is available connection in the pool with the same connection settings, it is taken from the pool instead of opening a new one.

    See Also

    LocalFailover  | Logging Onto The Server  | MySQL Specific Features