Home / Companies / Redis / Blog / Post Details
Content Deep Dive

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

Blog post from Redis

Post Details
Company
Date Published
Author
-
Word Count
1,763
Language
English
Hacker News Points
-
Summary

Active-active database replication faces challenges such as conflicting writes and the trade-offs between write latency, availability, and data integrity. Conflict-free Replicated Data Types (CRDTs) offer a solution by allowing data structures to merge automatically without special conflict-resolution code, thereby enabling concurrent updates to converge into a consistent state. CRDTs move conflict resolution from the application layer to the data structure itself, allowing for local writes at local speed and asynchronous updates between replicas. This approach is exemplified by the inventory counter problem, where CRDTs can signal issues like overselling by converging inventory counts in a way that reflects concurrent operations. While CRDTs are not a universal solution, they fit well with workloads involving operations like stock counts and audit logs, where merge semantics align naturally with the data's shape. Redis Cloud and Redis Software implement CRDTs for several data types, providing an effective solution for many real-time application patterns, although certain workloads may still require alternative strategies for maintaining specific invariants.