How Conflict-free Replicated Data Types power active-active database replication

This post details how Conflict-free Replicated Data Types (CRDTs) enable safer active-active database replication by providing data structures with built-in merge rules that allow concurrent updates to converge to a consistent state without application-level reconciliation. It contrasts CRDTs with Last Write Wins (LWW) and synchronous consensus protocols, highlighting the trade-offs in write latency, availability, and data integrity. The post uses an inventory counter example to illustrate how CRDTs signal data inconsistencies (e.g., negative inventory) rather than silently discarding data, allowing applications to handle such situations. It also lists the data types supported by Redis Active-Active replication with CRDT semantics (strings, hashes, lists, sets, sorted sets, streams, JSON, HyperLogLog) and notes limitations for unsupported types or workloads requiring tighter coordination.