Scenarios
Use an OceanBase read replica in the following scenarios:
Scenario 1: Your system handles a large volume of read requests, and the secondary replicas in your current OceanBase cluster instance can no longer manage the growing read workload. This results in longer response times and negatively impacts the user experience. You can add read replicas to distribute read requests and reduce the load on the primary cluster.
Scenario 2: Your business requires high stability for write requests, and you want to implement complete read/write splitting to prevent read request traffic from being sent to the primary cluster instance.
How it works
Read replicas for OceanBase cluster instances use the read-only replica type from the OceanBase database kernel. A read-only replica does not participate in log voting as a Paxos member. Instead, it acts as an observer that syncs logs from Paxos members in real time and replays them locally. It provides read-only services for business scenarios that do not require strong data consistency for reads. For more information about Paxos, see Paxos protocol.
At the agent layer, after you create a read replica endpoint, service traffic is routed to the read-only replica's machine to read data. This routing is configured in the agent service settings.
Prerequisites
The read replica feature for OceanBase Database is in a beta testing phase and is available by invitation only to whitelisted users. To use this feature, contact OceanBase technical support. To use the read replica feature, the following conditions must be met:
OceanBase Database version: V3.2.3, V3.2.4, or V4.2.1.
Instance type: The read replica feature is supported only for cluster instances. It is not supported for tenant instances or Serverless instances.
Series: Only the Standard Edition (cloud disk) series is supported.
Billing
Read replicas support the subscription and pay-as-you-go billing methods. For more information about billing rules, see Billing of read replicas.
When you create a read replica for a subscription or pay-as-you-go cluster instance, the lifecycle of the read replica is the same as the cluster instance.
If a cluster instance is locked upon expiration, its read replicas are also locked.
If a cluster instance is released after the expiration date, its read replicas are also released.
Features
Traffic distribution: You can use a read replica endpoint to route read traffic from your application to the read replica. This reduces the load on the primary cluster, especially in read-intensive application scenarios.
Horizontal scaling: Similar to cluster instances, read replicas support horizontal scaling of node specifications and the number of nodes. You can dynamically adjust read replicas to accommodate changes in read request volumes.
Data consistency: Data is synchronized between read replicas and the primary cluster with low latency. This ensures a high level of data consistency between the query results from a read replica and the data in the primary cluster. This feature makes read replicas suitable for complex Online Analytical Processing (OLAP) tasks, such as report generation and data analytics. It ensures data accuracy for analytics without interfering with the transaction processing of the primary cluster, which guarantees the stability and efficiency of core business operations.
Feature limitations
Deployment mode: You can create read replicas for cluster instances that are deployed across dual or multiple data centers. For each read replica that you add, you can create one additional agent endpoint.
Number of read replicas per zone: The number of read replica nodes in a single zone cannot exceed the number of cluster nodes in that zone. For example, if the Node Distribution on the Cluster Instance Workbench is 2-2-2, you can create a maximum of two read replica nodes in each zone.
Specification limits:
All nodes within a single read replica must have the same specifications. However, different read replicas can have different node specifications. The node specifications of a read replica cannot exceed those of a full-featured replica.
The node specifications of a read replica must be lower than the specifications of a node in the primary cluster.
The minimum supported node specification for a read replica is 4 cores for a V4.x cluster instance and 8 cores for a V3.x cluster instance.
Address limit
For a dual-data-center deployment, the agent layer supports one primary endpoint. You can add a maximum of one read-only or read/write splitting endpoint.
For a multi-data-center deployment, the agent layer supports one primary endpoint. You can add a maximum of two read-only or read/write splitting endpoints. If you need more endpoints, contact OceanBase technical support to request agent resources with larger specifications.
If you purchase additional read replicas, the number of endpoints that you can create increases by one for each new read replica added to the cluster. For more information about read replicas, see Add a read replica to a cluster.
Workflow
To use the read replica feature of OceanBase Database, you first create a read replica for the cluster instance. Then, you enable the read replica for a tenant in that cluster instance. Finally, you add a read replica endpoint for the tenant. For more information, see Add a read replica to a cluster, Add a read replica to a tenant, and Add an endpoint.