Overview
A G-Counter (Grow-only Counter CRDT) gives each of N replicas its own slot in an array P[0..N-1]. Replica i increments only its own slot P[i] += delta, the global value is sum(P), and any two replicas merge their states offline or peer-to-peer via P_merged[k] = max(P_1[k], P_2[k]). Because element-wise max is commutative, associative, and idempotent (a join-semilattice), concurrent updates converge deterministically without locks, consensus quorums, or a central server. A PN-Counter pairs two G-Counters (P for increments, N for decrements) with value sum(P) - sum(N).