There are two types of tenant roles in an OceanBase cluster: primary tenant (PRIMARY) and standby tenant (STANDBY). Tenants created under normal circumstances are primary tenants, and tenants created when using the physical standby database are standby tenants.
Tenant roles can be dynamically changed through switchover and failover operations.
Switchover
Switchover changes tenant roles as planned by the user. After executing the switchover operation, the primary tenant exchanges roles with the corresponding standby tenant. Throughout this process, no data is lost (RPO = 0), and execution time is generally in seconds.
Failover
Failover is usually performed when the primary tenant experiences an unrecoverable fault. After executing the failover operation, the corresponding standby tenant's role changes to PRIMARY. If failover is performed on a standby tenant that was synchronizing normally before the primary tenant failed, data loss generally occurs in the range of hundreds of milliseconds, and execution time is typically in seconds.