Skip to the content.

CRDT Distributed Counter

Please read this to understand what CRDT is.

The CRDT is a replicated data type that enables operations to always converge to a consistent state among all replicas nodes. The CRDT allows lock-free concurrent reads and writes to the distributed counter on any replica node.

CRDT-based consistency is a popular approach for multi-leader support because the CRDT offers high throughput, low latency for reads and writes, and tolerates network partitions. The CRDT achieves high availability by relaxing consistency constraints. The CRDT can even accept writes on the nodes that are disconnected from the cluster because the data updates will eventually get merged with other nodes when the network connection is re-established.

The CRDT replication exchanges not only the data but also the operations performed on the data including their ordering and causality. The merging technique in CRDT will execute the received operations on the data.

The following are the benefits of using CRDT to build the distributed counter:

Some of the popular CRDTs used in the industry are the following:

// TODO: What is handoff counter

How does CRDT work in distributed counter

Workflow of distributed counter

Reference