# 什么是顺序一致性(Sequential Consistency)

## 什么是顺序一致性？

… the result of any execution is the same as if the operations of all the processors were executed in some sequential order, and the operations of each individual processor appear in this sequence in the order specified by its program.


## 顺序一致性难吗？

sequential consistency for data race free programs


## Zookeeper 中的顺序一致性

Zookeeper 的一致性保证第一条是：

Sequential Consistency : Updates from a client will be applied in the order that they were sent.


（其实 zookeeper 文档里描述的顺序一致性和本文描述的不太一样）

Zookeeper 的所有写操作都通过主节点进行，从节点复制修改操作，这样所有节点的更新顺序都和主节点相同，不会出现某个节点的更新顺序与其它节点不同的情况。

2 -> 1
1 -> 2