Consistency of Distributed Data Services
摘要
In this chapter, we will introduce the concept of consistency in distributed data services, which is one of the most important concepts in this field. In distributed data services, clients are located in different geographical locations. If there is only one data source, the single-point load pressure and long-distance communication overhead are unbearable. Naturally, people have considered using multiple data sources and load balancing mechanisms to solve these problems. However, this brings new challenges, as multiple data sources can lead to data inconsistency due to the “replication lag” problem. This is because a client’s write request cannot reach different data sources simultaneously. Even if it could reach different data sources simultaneously, it is impossible to ensure that all data sources can successfully execute the write request. Therefore, users may encounter the following situation: client \(C_1\) requests the data service to update the value \(V_1\) to \(V_2\) , but another client \(C_2\) , located in a different geographical location, still sees the value as \(V_1\) . Although clients do not directly communicate with each other and thus will not discover this data anomaly, it indeed happens and can seriously affect the quality of the data service. In this chapter, we will introduce some data synchronization methods, data consistency levels, and data consistency/consensus algorithms to see how modern distributed systems solve these issues.