Skip to Main Content
Patterns of Distributed Systems
book

Patterns of Distributed Systems

by Unmesh Joshi
December 2023
Intermediate to advanced content levelIntermediate to advanced
464 pages
12h 35m
English
Addison-Wesley Professional
Content preview from Patterns of Distributed Systems

Chapter 23

Hybrid Clock

Use a combination of system timestamp and logical timestamp to have versions as date and time, which can be ordered.

Problem

When Lamport Clock is used as a version in Versioned Value, clients do not know the actual date-time when the particular versions are stored. It’s more convenient for clients to access versions using date and time like 01–01–2020 instead of an integer like 1, 2, 3.

Solution

Hybrid logical clock [Demirbas2014] provides a way to have a version which is monotonically increasing just like a simple integer, but also has relation to the actual date and time. Hybrid clocks are used in practice by databases like MongoDB77 or CockroachDB.78

77. https://www.mongodb.com/blog/post/transactions-background-part-4-the-global-logical-clock ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Designing Distributed Systems

Designing Distributed Systems

Brendan Burns