Vector Clock
定义 / Definition
向量时钟:分布式系统中用于追踪事件之间“因果先后关系”的一种逻辑时间戳机制。它用一个向量(每个节点/进程一个计数器)来记录本地事件与从其他节点观察到的事件,从而判断两个事件是先发生(happens-before)、后发生,还是并发(互不因果相关)。
发音 / Pronunciation (IPA)
/ˈvɛktər klɑːk/
例句 / Examples
We use a vector clock to detect concurrent updates.
我们用向量时钟来检测并发更新。
In a replicated database, vector clocks help reconcile conflicts by comparing the causal history of writes across nodes.
在复制型数据库中,向量时钟通过比较各节点写入的因果历史来帮助合并冲突。
词源 / Etymology
vector 源自拉丁语 vector(“携带者、运载者”),在数学与计算机中引申为“由多个分量组成的量”;clock 源自古英语 clocc(“钟”)。术语 vector clock 出现在分布式计算语境中,强调这是一种“像时钟一样记录时间”的方法,但记录的不是物理时间,而是由多个分量构成的逻辑时间。
相关词 / Related Words
文学与著作中的用例 / Notable Works
- Leslie Lamport, Time, Clocks, and the Ordering of Events in a Distributed System(1978)
- Colin J. Fidge, Timestamps in Message-Passing Systems That Preserve the Partial Ordering(1988)
- Friedemann Mattern, Virtual Time and Global States of Distributed Systems(1989)
- Martin Kleppmann, Designing Data-Intensive Applications(常讨论向量时钟/版本向量用于冲突解决)
- George Coulouris et al., Distributed Systems: Concepts and Design(分布式系统教材中常介绍向量时钟)