Each log stream is stored as multiple physical copies to ensure data security and high availability of data services. Each copy is called a replica of the log stream. Each replica contains three major types of data: static data of tablets stored in the SSTable on the disk, incremental data of tablets stored in the MemTable in the memory, and logs that record transactions. Several replica types are available depending on the types of data stored. This is to support the different business preferences in terms of data security, performance scalability, availability, and costs.
OceanBase Database V4.x supports the following types of replicas:
Full-featured replica (FULL/F)
A full-featured replica is also called a Paxos replica. Paxos replicas can constitute a Paxos group and participate in leader election and log voting.
Read-only replica (READONLY/R)
OceanBase Database V4.2.0 and later support read-only replicas. A read-only replica is also called a non-Paxos replica. Non-Paxos replicas cannot constitute a Paxos group or participate in leader election or log voting.
Columnstore replica (COLUMNSTORE/C)
OceanBase Database V4.3.3 and later support columnstore replicas. A columnstore replica, similar to a read-only replica, is also called a non-Paxos replica. Non-Paxos replicas cannot constitute a Paxos group or participate in leader election or log voting.
Replica type attribute
You can use the following syntax to specify the locality to determine the types and distribution of replicas:
LOCALITY='F{1}@z1,F@z2,R{1}@z3,C{1}@z4,F@z5'
In the preceding syntax, F{1}@z1, R{1}@z3, and C{1}@z4 are equivalent to F@z1, R@z3, and C@z4. The number in braces can only be 1.