Skip to main content
QUICK REVIEW

[Paper Review] Scalable Eventually Consistent Counters over Unreliable Networks

Paulo Sérgio Almeida, Carlos Baquero|arXiv (Cornell University)|Jul 11, 2013
Distributed systems and fault toleranceComputer Science20 references5 citations
TL;DR

This paper proposes Handoff Counters, a scalable, eventually consistent CRDT-based counter for unreliable networks that avoids the identity explosion problem in traditional CRDTs by localizing node ID entries and enabling garbage collection of retired nodes. By integrating protocol state into the CRDT state, it achieves AP (availability and partition-tolerance) behavior with strong consistency guarantees in the eventual sense, making it suitable for large-scale geo-replicated systems like web counters or social media 'likes'.

ABSTRACT

Counters are an important abstraction in distributed computing, and play a central role in large scale geo-replicated systems, counting events such as web page impressions or social network "likes". Classic distributed counters, strongly consistent, cannot be made both available and partition-tolerant, due to the CAP Theorem, being unsuitable to large scale scenarios. This paper defines Eventually Consistent Distributed Counters (ECDC) and presents an implementation of the concept, Handoff Counters, that is scalable and works over unreliable networks. By giving up the sequencer aspect of classic distributed counters, ECDC implementations can be made AP in the CAP design space, while retaining the essence of counting. Handoff Counters are the first CRDT (Conflict-free Replicated Data Type) based mechanism that overcomes the identity explosion problem in naive CRDTs, such as G-Counters (where state size is linear in the number of independent actors that ever incremented the counter), by managing identities towards avoiding global propagation and garbage collecting temporary entries. The approach used in Handoff Counters is not restricted to counters, being more generally applicable to other data types with associative and commutative operations.

Motivation & Objective

  • To address the scalability limitations of naive CRDT-based counters in large-scale, geo-replicated systems with unreliable networks.
  • To design a distributed counter that maintains availability and partition tolerance (AP) while ensuring correctness through eventual consistency.
  • To overcome the identity explosion problem in CRDTs, where state bloat occurs due to persistent tracking of all client IDs, including retired ones.
  • To enable efficient garbage collection of temporary entries from retired nodes without compromising correctness under arbitrary message loss or reordering.
  • To generalize the approach beyond counters to other data types with associative and commutative operations.

Proposed method

  • The approach uses a CRDT-based design where protocol state (e.g., handoff information) is embedded directly into the CRDT state, decoupling durable state from transient computation state.
  • It introduces a hierarchical structure with level-0 entries per client and higher-level aggregation, limiting the number of globally visible identifiers to only active participants.
  • A distributed gossip protocol is used over unreliable networks, where message duplication, reordering, or loss does not affect correctness due to monotonic state evolution.
  • The system distinguishes between durable state (preserved after crashes) and temporary state (used in computation), enabling safe garbage collection of retired nodes.
  • The merge operation is designed to be associative and commutative, ensuring convergence across replicas regardless of message order or delivery timing.
  • The protocol avoids relying on atomic or exactly-once messaging by treating all messages as idempotent state updates, with older state versions subsumed by newer ones.

Experimental results

Research questions

  • RQ1Can a scalable, eventually consistent counter be built that avoids the identity explosion problem inherent in naive CRDT-based counters?
  • RQ2How can CRDTs be extended to support garbage collection of retired nodes while maintaining correctness under unreliable communication?
  • RQ3Is it possible to achieve AP behavior in counters without relying on strong consistency or distributed transactions?
  • RQ4Can the CRDT model be generalized to other data types with associative and commutative operations beyond counters?
  • RQ5How can protocol state be integrated into CRDT state to improve fault tolerance and scalability in unreliable networks?

Key findings

  • Handoff Counters achieve scalability by localizing node ID entries, limiting the number of level-0 entries to only active participants, thus avoiding global state bloat.
  • The system supports garbage collection of entries from retired nodes during normal operation, reducing long-term state bloat without compromising correctness.
  • The approach tolerates arbitrary message loss, reordering, and duplication due to monotonic state evolution, making it robust over unreliable networks.
  • The solution provides eventual consistency with no over-counting or lost increments, even under network partitions or node failures.
  • The design is generalizable to other data types involving associative and commutative operations, not just counters.
  • Compared to server-based CRDTs, the approach improves availability by requiring only one reachable server after failure, not a majority of servers.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.