Apache SQL/Database Framework

Note: This page is of historic interest only. The DBD framework is incorporated in Apache APR (since version 1.2) and HTTPD (since version 2.2). Development and support take place at apache.org.

The Apache SQL/Database Framework serves to enable database applications efficiently within Apache 2.0 and higher. It updates our earlier connection pooling framework, and hence potentially offers an order of magnitude more scalability than traditional LAMP or CGI frameworks.

Figure 1

The DBD API decouples database support from applications. Instead of having an Authentication or Logging module for each of many databases, a single Authentication and a single Logging module will work with any database. Applications such as a Namespace module (mod_sql) or a scripting module such as those for Perl, PHP, and Python, can also benefit.

System Components

The components currently available are:

The apr_dbd framework presents a common API for different SQL database engines. The API is documented in apr_dbd.h.
DBD Drivers
APR DBD Drivers are currently available for MySQL and PostgreSQL. The apr_dbd architecture supports dynamic loading of database driver modules, so that new drivers can be installed at any time, without any requirement to recompile APR (provided the platform supports dynamic loading).
mod_dbd presents the API for Apache modules, and deals with managing database connections efficiently for both threaded and non-threaded MPMs.
mod_sql is an XML Namespace Module that builds on mod_dbd to implement SQL handling in XML applications with mod_publisher or mod_xmlns.


The apr_dbd base package is now in the current SVN repository at svn.apache.org. This includes the PostgreSQL driver, but not the MySQL driver.

The MySQL driver will not be committed to APR for the time being. Since MySQL is licensed under the GPL, we will respect that and distribute the MySQL driver also under the GPL. That is not compatible with ASF policy for Apache products, so for the time being at least it will be kept separate and distributed by WebÞing from this site.

mod_sql remains property of WebÞing and will be distributed from here.

apr_dbd_mysql.c is available under the GNU General Public License (GPL).