Databases
Databases
Relational databases on Quake AI run on a compute instance you control. The engine (PostgreSQL, MySQL, or MariaDB) writes to a dedicated Block Storage volume, the instance sits on a private network, and a security group limits which addresses reach the database port. Quake AI provides the instance, the volume, and the network path; you choose the engine, the version, and the operating schedule.
Two OpenTofu templates compose those pieces for you: Self-Managed PostgreSQL and MySQL/MariaDB Database. Both provision the instance, format and mount the data volume, install the engine through cloud-init, create a starting database and role, and write a scheduled dump to the data volume.
Get started#
- Deploy the self-managed PostgreSQL template with OpenTofu: PostgreSQL 16 on a private subnet with a mounted data volume and a nightly
pg_dumpall. - Deploy the MySQL/MariaDB database template with OpenTofu: MariaDB on a private subnet with a mounted data volume and a nightly
mysqldump. - Deploy a database sandbox: install SQLite or PostgreSQL by hand on a single VM to prototype against.
Choose a pattern#
| Pattern | Use it when |
|---|---|
| Self-Managed PostgreSQL | The workload speaks the PostgreSQL wire protocol and the database runs on its own instance. |
| MySQL/MariaDB Database | The workload speaks the MySQL wire protocol and the database runs on its own instance. |
| WordPress + MySQL on Compute | WordPress and its MariaDB backend deploy together. |
| Full-Stack Application | The database sits behind separate web and application tiers. |
| Deploy a database sandbox | You want a throwaway database on an existing VM without IaC. |
How-to guides#
- How to Connect to a Database on a Private Network: Find a database instance's private address, confirm the security group allows your source, and open a client session from an application instance or through a bastion tunnel.
Concepts#
Concepts
- Database Backup and Recovery: The recovery layers available to a self-managed database on Quake AI: scheduled logical dumps, volume snapshots, off-instance copies in Object Storage, and restore drills.
- Database Networking and Access: How applications and administrators reach a database on a Quake AI private subnet: private addressing, security group scope, database ports, and bastion paths.
- Self-managed Relational Databases: How a PostgreSQL or MySQL/MariaDB deployment on Quake AI composes a compute instance, a Block Storage data volume, a private network, and a security group.
Migration#
- How to Migrate MySQL or MariaDB to Quake AI: Move an existing MySQL or MariaDB database onto a Quake AI instance: check engine compatibility, dump the source, transfer through a bastion, restore, verify, and cut over.
- How to Migrate PostgreSQL to Quake AI: Move an existing PostgreSQL database onto a Quake AI instance: check versions, dump the source, transfer the dump through a bastion, restore, verify, and cut the application over.
Related services#
A database deployment draws on four other services: Compute runs the engine, Block storage holds the data directory, Network carries client traffic and enforces the security group, and Object storage holds dumps you copy off the instance. Automation covers the OpenTofu workflow the database templates use.