Skip to main content

Module pncounter

Module pncounter 

Source
Expand description

PN-Counter (Positive-Negative Counter) CRDT

A PN-Counter supports both increment and decrement operations by maintaining two separate counters: one for increments (P) and one for decrements (N). The value is P - N.

Each replica has its own counter entry, and the join operation performs component-wise max across all replicas.

Structsยง

PNCounter
A Positive-Negative Counter CRDT