Core Concepts
Reference
How-to Guides
Troubleshooting
Database Replication and Clustering
🏳️ Database Replication and Clustering is only available on the Growth, Scale, and Enterprise plans.
Aptible simplifies Database replication (PostgreSQL, MySQL, Redis) and clustering (MongoDB) databases in high-availability setups by automatically deploying the Database Containers across different Availability Zones (AZ).
Support by Database Type
Aptible supports replication or clustering for a number of Databases:
- Redis: Aptible supports creating read-only replicas for Redis.
- PostgreSQL: Aptible supports read-only hot standby replicas for PostgreSQL databases. PostgreSQL replicas utilize a replication slot on the primary database which may increase WAL file retention on the primary. We recommend using a Metric Drain to monitor disk usage on the primary Database. PostgreSQL Databases support Logical Replication using the
aptible db:replicate
CLI command with the--logical
flag for the purpose of upgrading the Database with minimal downtime. - MySQL: Aptible supports creating replicas for MySQL Databases. While these replicas do not prevent writes from occurring, Aptible does not support writing to MySQL replicas. Any data written directly to a MySQL replica (and not the primary) may be lost.
- MongoDB: Aptible supports creating MongoDB replica sets. To ensure that your replica is fault-tolerant, you should follow the MongoDB recommendations for a number of instances in a replica set when creating a replica set. We also recommend that you review the readConcern, writeConcern and connection url documentation to ensure that you are taking advantage of useful features offered by running a MongoDB replica set.
Creating Replicas
Replicas can be created for supported databases using the aptible db:replicate
command. All new Replicas are created with General Purpose Container Profile, which is the default Container Profile.
❗️Creating a replica on Aptible has a 6 hour timeout. While most Databases can be replicated in under 6 hours, some very large databases may take longer than 6 hours to create a replica. If your attempt to create a replica fails after hitting the 6 hour timeout, reach out to Aptible Support.