HyperDB
HyperDB is a very advanced database class that replaces a few of the WordPress built-in database functions. The main differences are: * HyperDB can be connect to an arbitrary number of database servers, * HyperDB inspects each query to determine the appropriate database. It supports: Read and write
About this tool.
HyperDB is a very advanced database class that replaces a few of the WordPress built-in database functions. The main differences are: * HyperDB can be connect to an arbitrary number of database servers, * HyperDB inspects each query to determine the appropriate database.
It supports:
- Read and write servers (replication)
- Configurable priority for reading and writing
- Local and remote datacenters
- Private and public networks
- Different tables on different databases/hosts
- Smart post-write master reads
- Failover for downed host
- Advanced statistics for profiling
- WordPress Multisite
It is based on the code currently used in production on WordPress.com with many MySQL servers spanning multiple datacenters.
Getting started.
Nothing goes in the plugins directory.
- 01Enter a configuration in db-config.php .
- 02Deploy db-config.php in the directory that holds wp-config.php . This may be the WordPress root or one level above. It may also be anywhere else the web server can see it; in this case, define DB_CONFIG_FILE in wp-config.php .
- 03Deploy db.php to the /wp-content/ directory. Simply placing this file activates it. To deactivate it, move it from that location or move the config file.
Any value of WP_USE_MULTIPLE_DB will be ignored by HyperDB.
Frequently asked questions.
What can I do with HyperDB that I can’t do with WPDB?
WordPress.com, the most complex HyperDB installation, manages millions of tables spanning thousands of databases. Dynamic configuration logic allows HyperDB to compute the location of tables by querying a central database. Custom scripts constantly balance database server resources by migrating tables and updating their locations in the central database.