Skip to content

Databases

Each WordPress VIP Platform environment is supported by a unique database. Unique databases per-environment allows testing to be performed on non-production environments without impacting the production environment.

HyperDB

  • VIP uses Automattic’s HyperDB db.php. No other db.php drop-ins can be used on the platform.
  • HyperDB is configured to send writes to an environment’s master database and sends reads to database replicas.

Database queries

  • Direct database queries in code should be avoided whenever possible. WordPress API functions for fetching and manipulating data should be used instead.
  • Slow queries that should be optimized in order to improve database efficiency can be reviewed in the Health – Slow Query Logs panel in the VIP Dashboard.
  • Database queries that run for longer than 60 seconds are automatically terminated. This is a default platform setting that is subject to change, and is not customizable per application.

Custom tables

Use caution when adding custom tables to a VIP Platform environment’s database.

  • To prevent unexpected issues, all tables should begin with the $wpdb->prefix table prefix.
  • Use dbDelta as part of an upgrade routine to add/update the table.
  • Do a thorough analysis of the schema and indexes and validate against the queries being run to ensure they match up.
  • Add caching to queries where it makes sense.

Last updated: August 31, 2023

Relevant to

  • WordPress