OceanBase Database Total Structure

OceanBase distributed database adopts the Shared-Nothing structure, the place every node is totally equal and has its personal SQL engine, storage engine, and transaction engine. It runs on a cluster of bizarre PC servers, offering core options akin to excessive scalability, excessive availability, excessive efficiency, low value, and excessive compatibility with mainstream databases.


An OceanBase database cluster consists of a number of nodes. These nodes belong to a number of availability zones (Zones), with every node belonging to at least one availability zone. An availability zone is a logical idea that represents a gaggle of nodes with related {hardware} availability inside the cluster. It may possibly have completely different meanings in several deployment modes. For instance, when the whole cluster is deployed inside the similar information heart (IDC), a node in an availability zone can belong to the identical rack or swap. When the cluster is distributed throughout a number of information facilities, every availability zone can correspond to a knowledge heart. Every availability zone has two properties: IDC and area, describing the IDC and the area to which the IDC belongs. Usually, the area refers back to the metropolis the place the IDC is situated. The IDC and area attributes of an availability zone must mirror the precise deployment state of affairs to make sure higher efficiency of computerized catastrophe restoration and optimization methods inside the cluster. Relying on the excessive availability necessities of the enterprise, OceanBase cluster supplies varied deployment modes, see Excessive Availability Structure Overview.

In OceanBase database, the info of a desk could be horizontally partitioned into a number of shards in accordance with sure partitioning guidelines. Every shard is named a desk partition or just a partition. A row of information belongs to and solely belongs to at least one partition. The partitioning guidelines are specified by the person when making a desk, together with hash, vary, checklist, and different varieties of partitioning, and assist for secondary partitions. For instance, within the order desk of a transaction database, it may be first partitioned into a number of main partitions primarily based on person IDs, after which every main partition could be additional divided into a number of secondary partitions primarily based on months. For a desk with secondary partitions, every sub-partition of the second degree is a bodily partition, whereas the primary degree partition is simply a logical idea. A number of partitions of a desk could be distributed throughout a number of nodes inside an availability zone. Every bodily partition has a storage layer object known as a Pill, used to retailer ordered information information.

When a person modifies the information in a Pill, to make sure information persistence, redo logs (REDO) have to be recorded within the log stream (Log Stream) equivalent to the Pill. Every log stream serves a number of Tablets on its node. To guard information and guarantee uninterrupted service in case of node failure, every log stream and its related Tablets have a number of replicas. Usually, these replicas are distributed throughout a number of availability zones. Among the many replicas, there is just one duplicate that accepts modification operations, known as the chief duplicate, whereas the others are known as follower replicas. The consistency of information between the chief and follower replicas is achieved by a distributed consensus protocol primarily based on Multi-Paxos. When the node the place the chief duplicate is situated fails, one of many follower replicas is elected as the brand new chief duplicate to proceed offering providers.

Every node within the cluster runs an observer service course of, which incorporates a number of working system threads. The performance of every node is equal. Every service is liable for accessing the partition information by itself node and for parsing and executing SQL statements routed to the native node. These service processes talk with one another by way of the TCP/IP protocol. On the similar time, every service listens for connection requests from exterior functions, establishes connections and database periods, and supplies database providers. For extra details about the observer service course of, see Thread Introduction.

To simplify the administration of deploying a number of enterprise databases on a big scale and scale back useful resource prices, OceanBase database supplies distinctive multi-tenancy options. Inside an OceanBase cluster, a number of remoted database “situations” known as tenants could be created. From the attitude of the applying, every tenant is an unbiased database. Moreover, every tenant can select both the MySQL or Oracle compatibility mode. When connecting to a MySQL tenant, customers can create customers and databases inside the tenant, offering an identical expertise to utilizing an unbiased MySQL library. Equally, when connecting to an Oracle tenant, customers can create schemas and handle roles inside the tenant, offering an identical expertise to utilizing an unbiased Oracle library. After a brand new cluster is initialized, there shall be a particular tenant named “sys,” known as the system tenant. The system tenant shops the metadata of the cluster and operates in MySQL compatibility mode.

Suitability of Options

The OceanBase database neighborhood version solely supplies the MySQL mode.

To isolate sources for tenants, every observer course of can have a number of digital containers known as useful resource models (UNIT) belonging to completely different tenants. Useful resource models of every tenant on a number of nodes kind a useful resource pool. Useful resource models embrace CPU and reminiscence sources.

To protect software applications from the small print of inner partitioning and duplicate distribution within the OceanBase database, and to make accessing a distributed database so simple as accessing a single.

Leave A Reply

Your email address will not be published. Required fields are marked *