Lindorm allows you to create an instance across multiple zones. In a multi-zone deployment solution, a Lindorm instance is deployed in multiple zones. Multi-zone instances can improve disaster recovery capabilities. The Lindorm instance can ensure strong data consistency across multiple zones. You can send requests to the Lindorm instance. The instance can return the results at a high speed if eventual consistency is required for data. This improves the service quality of your online business.
Overview of traditional primary/secondary disaster recovery

- A latency occurs when data is synchronized between the primary instance and the secondary instance. This way, strong consistency of data is not ensured.
The data synchronization link between the primary instance and the secondary instance is an asynchronous link. Business data can be synchronized to Secondary instance 2 only after the data is written to Primary instance 1. When a failover is performed, the latest data cannot be immediately read for business applications. However, the latest data needs to be immediately obtained for business applications. If your business uses atomic semantic interfaces, such as Increment and CheckAndPut, to read data before data is written and the latest data fails to be read, the data is out of order or data rollback occurs. If issues occur in the network in Zone A, the data in Zone B remains missing due to the synchronization latency during the time period before the network in Zone A is recovers.
- The resource utilization of the secondary instance is not high.
In scenarios in which primary/secondary disaster recovery is performed, the resources of the secondary instance are not used for most of the time. The resources are accessed only during the failover.
- The database administrator must perform the failover.
Primary/secondary disaster recovery must be completed on the business side. The database administrator of the business application needs to focus on the status of the primary instance. When the primary instance fails, the database administrator determines whether to switch workloads over to the secondary instance. You need to specify the custom logic and solution of the failover. The logic and solution affect your business.
Multi-zone architecture

- Strong consistency: If you set the consistency level of a table to strong consistency, data can be read only from the primary partition of the table and written only to the primary partition. The secondary partitions can receive data from the primary partition only by using the replica consensus protocol. When all the servers in the primary zone are terminated or the zone is unavailable, Lindorm automatically selects a primary zone. A period of time is required to promote a secondary zone to a primary zone. In strong consistency mode, you can read the most recent data that is written.
- Eventual consistency: Eventual consistency is also called weak consistency. If you set the consistency level of a table to eventual consistency, data can be read from the primary partition and secondary partition of the table, and written to the primary partition and secondary partition of the table. The replica consensus protocol is used to synchronize data that is written in Zone A to Zone B. The data of the replicas may be inconsistent because the data is asynchronously synchronized. In most cases, the synchronization latency is 100 ms. In eventual consistency mode, data can be read from the primary partition and secondary partition of a table, and written to the primary partition and secondary partitions of the table. Zone A is unavailable, and faults such as glitches and server failures occur during data write operations and data read operations. In this scenario, if the specified period of time elapses, no result is returned. In this case, you do not need to wait and the secondary zone does not need to be switched to the primary zone. Lindorm can automatically select Zone B to send requests. This helps ensure high availability, and reduces glitches of read and write operations.
Feature
Lindorm uses a distributed architecture that provides high availability. Some business has higher requirements on availability. Lindorm needs to handle some server failures and extreme problems such as network unavailability and city disasters. Multi-zone deployment provided by Lindorm supports the following features. These features can be used to ensure that databases are running as expected in various unexpected conditions.
- Multi-zone deployment provides disaster recovery capabilities at the data center level or city level.
- The strong data consistency requirements or eventual data consistency requirements of Lindorm instances can be met.
- Fault identification and failover operations are automatically triggered by Lindorm. This method is easy to use.
Feature | Multi-zone deployment | Primary/secondary disaster recovery | Paxos-based consistency protocol or Raft-based consistency protocol | |
---|---|---|---|---|
Strong consistency | Eventual consistency | |||
Data loss (recovery point objective (RPO)) | 0 | <100ms | <1s | 0 |
Service recovery (recovery time objective (RTO)) | 1 minute | 10~30s | RTO is determined based on the period of time that is required to perform a failover operation. | 30s to 3 minutes |
Access response time | Access data in the primary zone. In this case, data may be read and written across multiple zones. | Access data in the nearest zone. In this case, data can be read from and written to multiple zones. This reduces glitches. | Access data in the primary zone. In this case, data may be read and written across multiple zones. | Access data in the primary zone. In this case, data may be read and written across multiple zones. |
Ease of use | This solution does not affect business. | This solution does not affect business. | Business needs to be transformed. The external synchronization link is provided. You can switch links based on your business requirements. | This solution does not affect business. |
Minimum number of zones that are required to store logs and data |
|
|
|
|
- If your business does not require strong consistency, we recommend that you select a multi-zone Lindorm instance and set the consistency level of your table to eventual consistency.
- If your business requires strong consistency, we recommend that you select a multi-zone Lindorm instance and set the consistency level of your table to strong consistency.
Purchase a multi-zone Lindorm instance
You can purchase multi-zone Lindorm instances in the Lindorm console. For more information, see Create a multi-zone instance.
Select the consistency level
- The latest data must be read.
- Atomic semantic interfaces such as Increment and CheckAndPut need to be used.
- A secondary index for the table must be created.
Configure the consistency level of a table
- Use Lindorm-cli to connect to and use LindormTable and execute SQL statements to access LindormTable.
- Configure the CONSISTENCY attribute of the table.
- When you create a table, execute the following statement to set the CONSISTENCY attribute of the table to strong consistency:
When you create a table, execute the following statement to set the CONSISTENCY attribute of the table to eventual consistency:CREATE TABLE dt (p1 integer, p2 integer, c1 varchar, c2 bigint, constraint pk primary key(p1 desc))'CONSISTENCY'='strong';
CREATE TABLE dt2 (p1 integer, p2 integer, c1 varchar, c2 bigint, constraint pk primary key(p1 desc))'CONSISTENCY'='eventual';
- After the table is created, execute the following statement to change the value of the CONSISTENCY attribute for the table to eventual consistency.
After the table is created, execute the following statement to change the value of the CONSISTENCY attribute for the table to strong consistency.ALTER TABLE dt SET 'CONSISTENCY'='eventual';
ALTER TABLE dt2 SET 'CONSISTENCY'='strong';
- When you create a table, execute the following statement to set the CONSISTENCY attribute of the table to strong consistency:
Write data to a wide table
Multi-zone Lindorm instances are used in the same manner as single-zone instances. Connect to LindormTable and write data to a wide table. For more information, see Use Lindorm-cli to connect to and use LindormTable.
Import data to a wide table
- You can call an API operation to import data to a multi-zone or single-zone Lindorm instance. You need to only obtain an endpoint of the Lindorm instance in the Lindorm console and use the endpoint to import data.
- If you use BulkLoad to import data to a multi-zone Lindorm instance, import a copy of data in each zone. For more information, see Technical support.