Skip to content

theproductiveprogrammer/hybrid-logical-clock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hybrid Logical Clock

A Hybrid Logical Clock is a resilient and simple distributed clock that provides the ability for identity and ordering of messages in a distributed system.

logo

It is an improvement over Lamport timestamps and Vector Clocks and does not need the strong guarantees of Google’s True Time.

The Hybrid Logical Clock tolerates NTP kinks and mismatched clocks while still providing excellent behaviour and remaining stable.

Usage

Get the next id for every new message created:

id = hlc.nxt()

When receiving a remote message, update our clock with the remote information:

hlc.recv(remote.id)

And that’s it.

About

A better Distributed Vector Clock

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published