Back to Blog

RDS Read Replica Support for v2 Racks

Introduction

As part of our ongoing mission to enhance the capabilities of Convox's v2 racks, we are excited to announce the support for deploying read replicas. This new feature allows you to create read-only copies of your primary databases, facilitating better scalability and performance for read-heavy workloads.

What are Read Replicas?

Read replicas are read-only copies of your primary database. They allow you to offload read traffic from the primary database, enabling you to scale out read-heavy workloads efficiently. This ensures that your main database can focus on write operations, enhancing overall performance and scalability.

Feature Overview

Enhanced Performance and Scalability: By offloading read operations to replicas, you can significantly improve the performance of your applications and manage increased traffic seamlessly.

Simplified Configuration: Setting up read replicas is straightforward with Convox. You can configure them directly in your convox.yml file, ensuring quick deployment and easy management.

Seamless Conversion to Active Database: Convox allows you to convert a read replica into an independent, active database without affecting the original primary database, providing flexibility and robustness in your database management strategy.

Creating a Read Replica

To deploy a read replica using Convox, you need to reference the source database in your convox.yml file. Here’s an example configuration:

mysql-r:
 type: mysql
 options:
   readSourceDB: <db-identifier>
   class: db.t3.micro
   encrypted: true

Alternatively, you can reference an existing Convox DB resource within the same YAML file:

resources:
 mysql-main:
   type: mysql
   options:
     class: db.t3.micro
     encrypted: false
 mysql-r:
   type: mysql
   options:
     readSourceDB: "#convox.resources.mysql-main"
     class: db.t3.micro
     encrypted: true

Ensure that the source database is present before attempting to create the read replica.

Converting a Read Replica to an Active Database

If you need to convert a read replica into an active, independent database, simply remove the readSourceDB: <db-identifier> option from the convox.yml file and redeploy the application. This process will make the read replica an active database while keeping the original primary database unchanged.

Using the Feature

  1. Ensure Source Database Presence: Before creating a read replica, make sure the source database is available.
  2. Add Read Replica Configuration: Add the read replica configuration to your convox.yml file as shown above.
  3. Redeploy Application: Deploy your application to create the read replica.
  4. Convert to Active Database: To convert the read replica, remove the readSourceDB option from the convox.yml file and redeploy.

Conclusion

The introduction of read replica support in Convox's v2 racks underscores our commitment to providing robust and scalable database solutions. By leveraging this feature, you can enhance the performance and efficiency of your applications, ensuring they can handle increased read traffic with ease. This new capability is designed to simplify database management and improve overall application performance, allowing you to focus on building amazing things with Convox.

Let your team focus on what matters.