IndexModulesHandlers

Handler: MySQL bridge

This handler offers a lightweight database abstraction layer that will provide all the benefits of connection pooling. This in turn offers scalable advantages for high-load websites.

The original implementation of DBSlayer was a MySQL to JSON over HTTP bridge. This handler outperforms any other implementation by far, and besides JSON the handler can also process Python, Ruby and PHP.

DBSlayer

It also makes use of a balancing strategy to manage at least one information source: the MySQL server being bridged.

Parameters

Parameter Description
user The MySQL user to authenticate as.
password The MySQL user password to use.
db Optional. A MySQL database name.
lang Language from which the information will be consumed: json | python | ruby | php

Note that for this module to be correctly compiled, the MySQL database development files are required.

As stated above, the MySQL bridge handler is merely an abstraction layer. An excellent one at that, but that is all. No more, no less. This means you can perform regular operations on your database, but you cannot expect magic to happen. For instance, when you perform an INSERT, the Cherokee DB balancer will return a tuple indicating whether it succeeded or not, the number of rows affected, a rollback flag, etc. It will not, however, replicate the operation among each one of you MySQL servers. These arrangements must be made independently using MySQL's specific mechanisms.

Further information about this hanlder can be found in the cookbook, specifically in the recipe about setting up the MySQL balancing.