OceanBase Database provides flexible online scaling based on the distributed architecture. You can scale in or out an OceanBase cluster online while ensuring continuous availability of the cluster.
OceanBase Database is a distributed database system that consists of multiple zones. Multiple OBServer nodes are deployed in each zone. The following figure shows the architecture of OceanBase Database.

Compared with a conventional standalone database, OceanBase Database can provide flexible online scaling based on the distributed architecture. You can scale in or out an OceanBase cluster online while ensuring continuous availability of the cluster. When the disaster recovery requirement of a cluster changes, you can increase or decrease the number of zones to upgrade or downgrade the disaster recovery capability of the cluster. When the external loads of a cluster change, you can increase or decrease the number of OBServer nodes to change the load capacity of the cluster. The scaling capabilities of OceanBase Database are described in two aspects.
Zone scaling
An OceanBase cluster maintains multiple replicas for each data record. The multiple replicas constitute a basic high-availability unit based on the Paxos protocol. Usually, at most one data replica is deployed in each zone. When a minority of zones fail, replicas in other zones can still provide services while ensuring data integrity based on the Paxos protocol. You can increase the number of zones to increase the number of data replicas, so as to improve system availability. Here is an example:
An OceanBase cluster contains three zones: Zone1, Zone2, and Zone3. Each data record in the cluster has three replicas, which are respectively deployed in these three zones. To improve system availability, you can increase the number of data replicas to 5. To achieve this goal, you can increase the number of zones. First, add Zone4 and Zone5 to the cluster. Then, add OBServer nodes to Zone4 and Zone5. Finally, deploy new data replicas in Zone4 and Zone5 based on your business requirements to complete dynamic zone scale-out. Similarly, you can decrease the number of zones to complete dynamic zone scale-in.
OBServer scaling
To linearly upgrade the database service capability, OceanBase Database supports dynamic scaling of OBServer nodes in each zone. You can adjust the number of OBServer nodes in each zone to upgrade the service capability. Here is an example:
An OceanBase cluster contains three zones: Zone1, Zone2, and Zone3. N OBServer nodes are deployed in each zone. All the 3N OBServer nodes provide read and write services. When the service capability of the OceanBase cluster is insufficient for handling read and write requests, you can scale out the OceanBase cluster to upgrade its service capability. You can add three OBServer nodes to the cluster, with one OBServer node in each zone. After the scale-out, each zone contains N+1 OBServer nodes. Dynamic scale-out increases the number of OBServer nodes in the cluster. RootService distributes some of the original data and loads in the cluster to the newly added OBServer nodes based on the internal load balancing mechanism. For more information about load balancing mechanisms and strategies, see Resource unit balancing.
Similarly, when the service capability of OBServer nodes in the cluster is redundant for the current load, you can remove OBServer nodes to reduce the costs of the cluster. The OBServer nodes to be removed are called to-be-deleted nodes. Specifically, you can run cluster management commands to migrate data and loads from to-be-deleted nodes to other OBServer nodes and then recycle the to-be-deleted nodes to complete OBServer node scale-in.