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)
Read-only replica (READONLY/R)
OceanBase Database V4.2.0 and later support read-only replicas.
A full-featured replica is also called a Paxos replica. Paxos replicas can constitute a Paxos group and participate in elections. A read-only replica is also called a non-Paxos replica. Non-Paxos replicas cannot constitute a Paxos group or participate in elections.
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,F@z4,F@z5'
In the preceding syntax, F{1}@z1 and R{1}@z3 are equivalent to F@z1 and R@z3. The number in braces can only be 1.