• Linearizability


     Linearizablity at a Single Site

     

    Note that:

      In (1)(2)(3) get()s and inc()s appear to be executed in sequential order

    -------- (Edited on Mar. 15th, 2020)

    More precise definition of linearizability:

      1. all operations appear to be executed in sequential order, i.e. there exists a total order of all operations

          2. the order matches real-time

          3. reads see preceding writes in the order

    According to this definition, history of get()s and inc()s in (1) is also linearizable

    Another imprecise statement above is that "get()s and set()s in (1) are executed sequentially". A more precise description would be "critical sections of get()s and set()s in (1) are executed sequentially"

    Linearizablity of Distributed Systems 

    Linearizability forbids:

         1.  split brain

         2. forgetting commited writes after reboot

         3. read from lagging replicas

         4. nonmonotonic reads

    ...

    Linearizability v.s. Serializability

    Linearizability is a guarantee about single operations on single objects, It provides a real-time guarantee on the behavior of a set of single operations (often reads and writes) on a single object (e.g., distributed register or data item).

    Serializability is a guarantee about transactions, or groups of one or more operations over one or more objects. It guarantees that the execution of a set of transactions (usually containing read and write operations) over multiple items is equivalent to some serial execution (total ordering) of the transactions. Unlike linearizability, serializability does not—by itself—impose any real-time constraints on the ordering of transactions. Serializability does not imply any kind of deterministic order—it simply requires that some equivalent serial execution exists.

    Strict serializability, transaction behavior is equivalent to some serial execution, and the serial order corresponds to real time.

    For example, say I begin and commit transaction T1, which writes to item x, and you later begin and commit transaction T2, which reads from x. A database providing strict serializability for these transactions will place T1 before T2 in the serial ordering, and T2 will read T1’s write. A database providing serializability (but not strict serializability) could order T2 before T1.

    Linearizability can be viewed as a special case of strict serializability where transactions are restricted to consist of a single operation applied to a single object.

           

    References

      Wikipedia Page for Linearizability:  https://en.wikipedia.org/wiki/Linearizability

          Peter Bailis's Blog: Linearizability versus Serializability

      JEPSEN Consistency Models: https://jepsen.io/consistency

          JEPSEN Linearizability: https://jepsen.io/consistency/models/linearizable

        Kyle Kingsbury's Blog: Serializability, Linearizability, and Locality

          Peter Bailis's Paper: Highly Available Transactions: Virtues and Limitations

  • 相关阅读:
    lnmp一键安装包,安装多版本php,并开启redis与swoole
    wangEditor的使用
    记一次傻逼的录入
    PHP自动加载
    pip升级
    Ubuntu安装mycli,让mysql命令行可以自动提示
    Redis存储AccessToken
    微信小程序生成太阳码
    巧妙的新订单提醒功能
    使用pt-query-digest进行日志分析
  • 原文地址:https://www.cnblogs.com/william-cheung/p/11228978.html
Copyright © 2020-2023  润新知