Scenarios
Users can consider purchasing OceanBase read-only replicas to cope with the following scenarios:
Scenario 1: The system receives a large number of read requests, and the existing standby replicas in the current OceanBase cluster instance cannot cope with the increasing read load, leading to extended response times and negatively impacting user experience. In this case, additional read-only replica resources are needed to distribute the read requests and reduce the pressure on the primary instance.
Scenario 2: High stability is required for write requests, and the goal is to implement complete read/write separation so that read request traffic does not go back to the original cluster instance.
Technical principles
The read-only replica feature of OceanBase Cloud is implemented through the read-only replicas feature in the OceanBase Database. It does not participate as a Paxos member in log voting but instead acts as an observer, catching up with the logs of Paxos members in real-time and replaying them locally. This allows it to provide read-only services when high consistency is not required for data reading. For more information about Paxos, see Paxos protocol.
At the proxy level, after you create an endpoint for a read-only replica, you can configure the proxy service so that business traffic is directed to the read-only replica for data reading.
Prerequisites
OceanBase Database version: No version requirement for read-only replicas, and V4.3.3 or later for columnstore read-only replicas.
Supported instance type: transactional instances
Supported cloud provider: Alibaba Cloud, Tencent Cloud, Huawei Cloud, AWS
Billing
Supported billing method: pay-as-you-go.
When you create a read-only replica for an instance with a billing method of pay-as-you-go, the lifecycle of the read-only replica is the same as that of the instance.
If the instance is locked, the read-only replica will also be locked.
If the instance is released, the read-only replica will also be released.
Features
Traffic offloading: You can guide applications to distribute read traffic to read-only replicas through read-only replica endpoints. This reduces the load on the instance, especially in read-intensive scenarios.
Scaling out: Like instances, read-only replicas support node and capacity scaling. You can adjust the specifications and scale nodes of read-only replicas based on your business needs to adapt to fluctuations in read requests at different times.
Data consistency: The data consistency of read-only replicas and read-only columnstore replicas is eventual consistency, which is achieved by the asynchronous replication based on the Paxos protocol of OceanBase Database. You need to reasonably assess the consistency requirement of your business when using these replicas.
Limitations
Deployment limitation: For instances deployed in two or multiple IDCs, OceanBase Database supports creating read-only replicas. For each additional read-only replica created, one more proxy endpoint can be created.
Limitation on the number of read-only replicas per zone: The number of read-only replica nodes in a single zone cannot exceed the number of nodes in the same zone of the instance. For example, if an instance has 2 nodes in each of three zones (2-2-2), no more than 2 read-only replica nodes can be created in each zone.
Specification limitations:
The node specifications in the same read-only replica must be consistent. The node specifications in different read-only replicas can vary.
The node specifications in all read-only replicas must be smaller than those of the instance.
For read-only replica node specifications, if the instance is of OceanBase Database V4.x, the minimum specification supports 4-core configurations. If the instance is of OceanBase Database V3.x, the minimum specification supports 8-core configurations.
Limitation on the number of read-only replicas:
Versions earlier than V4.3.5 support creating up to 3 read-only replicas or columnstore read-only replicas, or any combination of two types. Versions from V4.3.5 onwards support creating up to 10 read-only replicas.
Each time you purchase an additional read-only replica for the instance, the number of endpoints that can be created increases by one.
Procedure
To use the read-only replica feature of OceanBase Cloud, you need to create read-only replicas for the instance and enable read-only replicas for tenants under the instance, and then add endpoints for the tenants. Specific steps are as follows: Add a read-only replica to an instance, Add a read-only replica to a tenant, and Add an endpoint.