In distributed applications, Brewer's CAP theorem tells us that when networks become partitioned, there is a tradeoff between consistency and availability. Consistency is agreement on the values of shared variables across a system, and availability is the ability to respond to reads and writes accessing those shared variables. We quantify these concepts, giving numerical values to inconsistency and unavailability. Recognizing that network partitioning is not an all-or-nothing proposition, we replace the P in CAP with L, a numerical measure of apparent latency, and derive the CAL theorem, an algebraic relation between inconsistency, unavailability, and apparent latency. This relation shows that if latency becomes unbounded (e.g., the network becomes partitioned), then one of inconsistency and unavailability must also become unbounded, and hence the CAP theorem is a special case of the CAL theorem. We describe two distributed coordination mechanisms, which we have implemented as an extension of the Lingua Franca coordination language, that support arbitrary tradeoffs between consistency and availability as apparent latency varies. With centralized coordination, inconsistency remains bounded by a chosen numerical value at the cost that unavailability becomes unbounded under network partitioning. With decentralized coordination, unavailability remains bounded by a chosen numerical quantity at the cost that inconsistency becomes unbounded under network partitioning. Our centralized coordination mechanism is an extension of techniques that have historically been used for distributed simulation, an application where consistency is paramount. Our decentralized coordination mechanism is an extension of techniques that have been used in distributed databases when availability is paramount.
翻译:在分布式应用程序中,Brewer的Cap 理论告诉我们,当网络被分割时,在一致性和可用性之间存在着平衡。一致性是就整个系统共享变量的价值达成一致,而可用性是能够对读和写访问这些共享变量作出反应。我们量化这些概念,使数字值具有不一致和无法使用之处。我们认识到网络分割不是一成不变的主张,我们用L取代了CAP中的P,这是一个明显的延缓度的数字尺度,并得出CAL的顶点,在不一致、不可用和明显的延缓之间存在着代数关系。这一关系表明,如果延迟分配(例如,网络被分割)的值是全系统共享变量的值,那么一个不一致和不可用性的概念也必须是不受约束的,因此CAL 理论是CAP的特例。我们描述了两个分布式协调机制,我们作为Longua Franca 协调语言的延伸,用来支持一致性和可用性之间的任意偏差,而明显的延度是不同的。随着集中式协调,不一致性仍然是由所选择的透明化的网络内部分配法,因此,一个由我们选择的中央分配式分配式计算法性机制成为了一种不固定的不固定的不一致性。