Use cases
Consider purchasing OceanBase read-only replicas to meet business needs in the following scenarios:
Scenario 1: The system faces a large volume of read requests, and the standby replicas in the current OceanBase cluster instance can no longer handle the growing read load, leading to prolonged response times and poor user experience. In this case, you need to add read-only replica resources to distribute read requests and reduce the pressure on the primary cluster.
Scenario 2: The business scenario requires extremely high stability for write requests, and you want to achieve complete read/write splitting so that read request traffic is not sent to the original cluster instance.
How it works
The read-only replica feature for OceanBase database cluster instances is implemented through the Read-Only Replica in the OceanBase database kernel. It does not participate in log voting as a Paxos member but acts as an observer, continuously synchronizing logs from Paxos members and replaying them locally. This provides read-only services when the business does not require high consistency for data reads. For more information about Paxos, see Paxos protocol.
After creating an endpoint for a read-only replica, configure the proxy to route read traffic to the server that hosts the replica.
Prerequisites
OceanBase Database version: There are no version restrictions for using read-only replicas. However, read-only columnstore replicas require the database version to be V4.3.3 or later.
Supported instance type: Cluster instance (transactional)
Supported cloud vendor channel: AWS
Note
Some instances do not currently support enabling read-only replicas. If you have urgent read-only requirements, contact technical support to assist you in evaluating feasible alternative solutions.
Billing
Read-only replicas support pay-as-you-go billing. For details, see Read-only replica billing instructions.
When creating a read-only replica for a pay-as-you-go cluster instance, the lifecycle of the read-only replica is consistent with that of the cluster instance.
If a cluster instance is locked after expiration, its read-only replicas are also locked.
After a cluster instance is released upon expiration, the read-only replica is also directly released.
Features
Traffic distribution: Use the read-only replica endpoint to direct applications to distribute read traffic to the read-only replica, reducing the load on the cluster instance, especially in read-intensive application scenarios.
Horizontal scaling: Like the cluster instance, read-only replicas support specification scaling and node scaling. Therefore, you can dynamically adjust read-only replicas based on business needs to adapt to changes in read requests at different times.
Data consistency: The data consistency of read-only replicas and read-only columnstore replicas is eventual consistency, achieved through asynchronous replication via OceanBase's kernel Paxos. When using this feature, you need to reasonably assess your business's data consistency requirements.
Limitations
Deployment scheme limitations: For cluster instances deployed in dual-IDC or multi-IDC mode, OceanBase Database supports creating read-only replicas. Each additional read-only replica allows you to create one more proxy endpoint.
Specification limitations:
The node specifications within a read-only replica must be consistent; node specifications across different read-only replicas can vary.
For the node specification of a read-only replica, if its cluster instance is V4.x, the minimum supported node specification is 4 cores. If its cluster instance is V3.x, the minimum supported node specification is 8 cores.
Read-only replica quantity limitations
For database versions earlier than V4.3.5, a maximum of 3 read-only replicas, read-only columnstore replicas, or any combination of both can be created. For V4.3.5 and later, a maximum of 10 read-only replicas can be created.
If you subsequently purchase additional read-only replicas, the number of available access endpoints increases by one for each new read-only replica instance added to the cluster.
Procedure
To use the read-only replica feature of OceanBase Database, you need to first create read-only replicas for the cluster instance, then enable read-only replicas for tenants under that cluster instance, and finally add read-only replica access endpoints for the corresponding tenants. For specific procedure steps, refer to Add a read-only replica to a cluster, Add a read-only replica to a tenant, and Add an access endpoint.