OceanBase Database provides flexible online scaling based on the distributed architecture. You can scale in or out an OceanBase Database cluster online while ensuring continuous availability of the cluster.
OceanBase Database is a distributed database system that consists of multiple zones. Multiple OBServers 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 Database 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 OBServers to change the load capacity of the cluster. The scaling capabilities of OceanBase Database are described in two aspects.
Zone scaling
An OceanBase Database cluster maintains multiple replicas for each data record. The multiple replicas constitute a basic high-availability unit based on the Paxos protocol. Typically, at most one replica is deployed in each zone. When a minority of zones fail, replicas in other zones can still provide services based on the Paxos protocol while ensuring data integrity. You can increase the number of zones to increase the number of data replicas, so as to improve system availability. Example:
An OceanBase Database cluster contains three zones: Zone1, Zone2, and Zone3. Each data record in the cluster has three replicas, which are respectively deployed in the 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 OBServers 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 OBServers in each zone. You can adjust the number of OBServers in each zone to upgrade the service capability. Example:
An OceanBase Database cluster contains three zones: Zone1, Zone2, and Zone3. N OBServers are deployed in each zone. All the 3N OBServers provide read and write services. When the service capability of the OceanBase Database cluster is insufficient for handling read and write requests, you can scale out the OceanBase Database cluster to upgrade its service capability. Add three OBServers to the cluster, with one OBServer in each zone. After the scale-out, each zone contains N+1 OBServers. Dynamic scale-out increases the number of OBServers in the cluster. RootService distributes some of the original data and loads in the cluster to the newly added OBServers based on the internal load balancing mechanism. For more information about load balancing mechanisms and strategies, see Resource unit balancing and Data balancing.
Similarly, when the service capability of OBServers in the cluster is redundant for the current load, you can remove OBServers to reduce the costs of the cluster. The OBServers to be removed are called to-be-deleted OBServers. Specifically, you can run cluster management commands to migrate data and loads from to-be-deleted OBServers to other OBServers, and then recycle the to-be-deleted OBServers to complete OBServer scale-in.