惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Microsoft Security Blog
Microsoft Security Blog
Google DeepMind News
Google DeepMind News
P
Privacy International News Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
T
Threatpost
GbyAI
GbyAI
V
Visual Studio Blog
H
Help Net Security
Vercel News
Vercel News
P
Palo Alto Networks Blog
Project Zero
Project Zero
AWS News Blog
AWS News Blog
Latest news
Latest news
Cyberwarzone
Cyberwarzone
C
Cybersecurity and Infrastructure Security Agency CISA
The Register - Security
The Register - Security
博客园_首页
WordPress大学
WordPress大学
G
GRAHAM CLULEY
T
Tor Project blog
有赞技术团队
有赞技术团队
Know Your Adversary
Know Your Adversary
AI
AI
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
O
OpenAI News
博客园 - 聂微东
月光博客
月光博客
S
Security Affairs
Webroot Blog
Webroot Blog
L
LangChain Blog
Apple Machine Learning Research
Apple Machine Learning Research
NISL@THU
NISL@THU
N
News and Events Feed by Topic
Blog — PlanetScale
Blog — PlanetScale
S
Securelist
V
Vulnerabilities – Threatpost
aimingoo的专栏
aimingoo的专栏
阮一峰的网络日志
阮一峰的网络日志
Stack Overflow Blog
Stack Overflow Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
D
DataBreaches.Net
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Y
Y Combinator Blog
Cisco Talos Blog
Cisco Talos Blog
The Cloudflare Blog
IT之家
IT之家
博客园 - 三生石上(FineUI控件)
雷峰网
雷峰网
L
Lohrmann on Cybersecurity
T
The Blog of Author Tim Ferriss

Redis

Real-Time Fraud Detection: Latency, Features & Scale Context window in AI: why every token is a budget decision Connecting to Redis Cloud with AWS PrivateLink vs. VPC peering | Redis Redis Data Integration in Redis Cloud is now GA in AWS | Redis Why AI Misses Business Context & How Teams Fix It AI Reasoning Explained: Why Context Matters Semantic Layer vs Context Layer: Key Differences Redis array data type: How it works and when to use it Context Graphs vs. Vector Search: When RAG Falls Short What’s new in two – May 2026 edition Redis 8.8 performance improvements: Faster string, hash, streams, SCAN & more Redis 8.8: New array data structure & open source features Context Orchestration: What It Is & How It Works Context Compaction for AI Agents: A Complete Guide Prompt Bloat: Causes, Costs & Fixes for LLM Apps Agentic Retrieval Techniques: A Complete Guide Single-shot reliable consumers with XREADGROUP CLAIM in Redis 8.4 | Redis Long-Horizon AI Agents: Memory & State Infrastructure What is a context engine? What Is a Context Layer? AI Agent Infrastructure Context Retrieval for AI Agents: What It Is & Why It Matters Context Poisoning: How Bad Data Breaks Agent Reasoning Context is all you need: Introducing Redis Iris | Redis Context Engineering for AI: What It Is & How to Build It Dynamic endpoints: Migrate databases without changing your endpoint | Redis AI Shopping Assistants: How They Work & What to Build Endless Aisle Retail: Infrastructure & Real-Time Data LLM Speed Benchmarks: Metrics & Infrastructure Guide Context Pruning: Cut LLM Tokens Without Losing Quality What’s new in two – April 2026 edition Agentic AI Architecture: 5 Patterns Explained AI Agent vs Chatbot: Key Differences Explained Advantages of Building a Vector Search Solution API Latency in LLM Apps: Causes & How to Fix It Security advisory: [CVE‑2026‑23479] [CVE‑2026‑25243] [CVE-2026-25588] [CVE‑2026‑25589] [CVE-2026-23631] | Redis Edge Computing Latency: Causes & How to Reduce It AI Agents vs Workflows: When to Use Each Streaming LLM Responses: Make Your AI App Feel Fast Active-Active vs Active-Passive Database Architecture Prefill vs Decode: LLM Inference Phases Explained Long-Term Memory Architectures for AI Agents Time to First Byte Test: Tools, Causes & Fixes Speculative decoding: how it works & when to use it P95 Latency: What It Is & Why It Matters Why Multi-Agent LLM Systems Fail & How to Fix Them AI Human in the Loop: Production Oversight Patterns Native OpenTelemetry metrics for Redis client libraries | Redis Client-side geographic failover for Redis Active-Active | Redis Use Redis with SQL | Redis Introducing Redis Feature Form Build Google ADK Agents with persistent, real-time memory on Redis | Redis Startup Spotlight: Neuron Systems API Throttling: Algorithms, Patterns & Mistakes Agentic AI Examples Across 6 Industries Best Chunking Strategies for RAG Pipelines Agentic AI Guardrails: Controls That Work Redis joins AWS at GDC to support the next generation of gaming | Redis Designing a semantic routing system: From static rules to dynamic intelligence with Redis and Java | Redis Real-Time Dispatch System: A Complete Guide P99 Latency: What It Means & How to Fix It Tokenization in LLMs: What AI App Devs Need to Know TTFT Meaning: What is Time to First Token? Atomic slot migration with Redis 8.4 Hybrid search benefits: Why your RAG system needs both keyword & vector search What’s new in two: March 2026 edition Vector embedding generators: How they work & how to use them Throughput-optimizing Redis for L2 KV Cache Reuse What is a data pipeline? Building AI agent pipelines that don't forget, fail, or fall apart Redis achieves Google Cloud Ready, Distributed Cloud status ahead of Google Cloud Next ‘26 | Redis Real-time network monitoring: what your data platform needs to keep up AI agent API: How agents connect to the real world What is multicloud infrastructure? A guide for 2026 What is a transaction monitoring system & how does it work? Why your AI agent fails in production & how tracing helps AI agent benchmarks: Where they fall short & why your infrastructure matters What is a JSON database (and when should you use one)? Introducing the Redis Partner Network: A new foundation for real-time innovation How real-time customer segmentation works in retail Payment orchestration & vault architecture in retail Agentic systems vs. GenAI: when generation isn't enough What is fuzzy matching? Semantic caching & routing: two powerful patterns for vector classification Redis alternatives: Why there are no exact substitutes Connect to Azure Managed Redis with Redis Insight 3.2.0 How to tame the thundering herd problem Redis to Manage Storage Replication | Redis How hierarchical navigable small world (HNSW) algorithms can improve search | Redis How leading financial institutions use Redis to drive growth | Redis What’s new in two: May 2025 | Redis Introducing Model Context Protocol (MCP) for Redis | Redis Redis vs. Elasticsearch: What’s faster for GenAI & vector search? | Redis Build fast, production-worthy AI apps with Spring AI and Redis | Redis Azure Managed Redis is GA today | Redis Redis then & now: Adapting with developers through every era | Redis Supercharge Your AI with OpenShift AI and Redis: Unleash speed and scalability | Redis What’s new in two: April 2025 | Redis Redis 8 is now GA, loaded with new features and more than 30 performance improvements | Redis What is a data strategy? 6 key components explained Data replication explained: types, examples & use cases
How Conflict-free Replicated Data Types power active-active database replication
Redis · 2026-05-27 · via Redis

Your application runs in three regions. A customer in Tokyo buys the last unit of a product at the exact moment a customer in Frankfurt buys the same SKU. Both writes succeed locally. Both replicas decrement inventory. Which region's view is correct, and what happens to the order that "lost"?

That question sits at the heart of active-active replication, and for most distributed database architectures, the answer involves painful trade-offs: higher write latency, silent data loss, or brittle application-level reconciliation. Conflict-free Replicated Data Types (CRDTs) offer a different approach: data structures designed to merge automatically for supported data types, without special conflict-resolution code or human intervention.

This article explains why active-active replication creates conflicts in the first place, how CRDTs merge concurrent updates into a consistent state, and what kinds of workloads they fit (and don't).

Why active-active replication is hard

Active-active replication is hard because two regions can accept conflicting writes to the same data at the same time, and there's no universally safe way to resolve them after the fact. Every architectural choice trades off write latency, availability, or data integrity, and the wrong choice can silently lose committed data.

Here's why. During a network partition, you can't have both strong consistency and full availability, so you have to choose. A single-leader (primary-replica) setup chooses consistency by routing every write through one node, which makes conflicts impossible by design but creates a bottleneck and a single point of failure. Active-active gives up that guarantee so every region can write locally, which means two nodes can update the same key at the same time without either one knowing about the other's change until replication catches up.

That leaves two ways to keep the data sane. The first is to coordinate every write globally using a consensus protocol like Paxos or Raft. The protocol elects a leader, funnels writes through it, and confirms each commit with a quorum of replicas before acknowledging the client. That's safe, but slow at global scale. Spanner's cross-region docs report about 100 ms strong-read latency between us-east1 and a leader in europe-west4, almost all of it round-trip network time. Every write pays that toll.

Database

Get started with Redis for faster apps

Reduce latency and handle data in real time.

The second option is to skip coordination and reconcile later, usually with Last Write Wins (LWW). When two regions update the same key, the write with the later timestamp survives and the other is silently discarded. It's fast, but the data loss is invisible. Your application thinks both writes succeeded. Only one actually did.

Real-world replication architectures come in many flavors, and most production systems blend patterns. But the broad design choices reduce to a small set of trade-offs, summarized below:

ArchitectureWrite latencyFailure mode at global scale
Primary-replicaHigh (all writes to single primary)Geographic read-write latency; single point of failure on promotion
Active-passiveMedium (primary only)Failover gap: unavailable for writes until promotion completes
Active-active (synchronous)High (inter-region quorum)Latency tied to slowest quorum member
Active-active (asynchronous)Low (local only)Write conflicts, split-brain, silent data loss

The bottom row is where most globally distributed applications want to live. Active-active with asynchronous replication gives you the best write latency, but the worst conflict story. CRDTs are what make that approach safer to operate, by changing how conflicts are handled for data types whose semantics fit the model.

What CRDTs are

CRDTs make this work by moving conflict resolution out of the application layer. A CRDT is a data structure whose merge rules are built into the data type itself. Independent copies on different nodes can be updated separately and still converge to the same consistent state without coordination, because the rule for combining concurrent updates is part of the data type's definition rather than something the application layer has to figure out at runtime.

That's the shift. Conflict resolution stops being a hard problem the application owns and becomes a property of the data structure. Developers no longer have to reason about clocks, ordering, retries, replication lag, and partial failures every time they update shared state. The math handles it, as long as two replicas eventually exchange state.

For active-active replication, that's a strong fit. Each region accepts local writes at local speed, replicas exchange updates asynchronously, and the data converges without forcing every operation through global coordination.

How merge behavior changes the problem

CRDTs don't eliminate conflicts. They change the question from "which region wins?" to "what should this data structure preserve when concurrent updates arrive?" and answer it at the data-type level.

For supported operations, the data type already defines what a valid merge looks like:

  • Counters: Both increments survive, and the final value is the sum of all updates across regions.
  • Sets: Each region's additions are preserved as separate operations, so the merged set contains the union of all additions.
  • Maps and structures with independent fields: Concurrent updates to different fields merge cleanly because the operations don't actually conflict.

For data shaped like membership, flags, or accumulated state, those merge rules sit much closer to business intent than discarding one side with Last Write Wins. CRDTs aren't a single technique. They're a family of merge-safe data structures, each with its own conflict rules. That's the layer Active-Active Geo Distribution builds on. Available on Redis Cloud and Redis Software, it provides multi-region writes with automatic conflict resolution via CRDTs, so local writes happen in multiple regions and replicas converge without application-layer reconciliation.

Redis Cloud

Build faster with Redis Cloud

Get Redis up and running in minutes, then scale as you grow.

A concrete example: the inventory counter problem

Shared inventory counters are one of the clearest ways to see why overwrite-based conflict handling can be dangerous. Picture the SKU from the opening scenario: one unit left, replicated to both regions. The Tokyo customer's order arrives first locally, so the Tokyo region's count drops to 0 and the order proceeds. At nearly the same moment, the Frankfurt region still shows 1 unit (replication hasn't caught up), so the Frankfurt customer's order proceeds there too, dropping Frankfurt's count to 0.

In an overwrite model like Last Write Wins, both regions wrote the same value (0), so the merged count looks completely consistent. The system has no idea anything went wrong. Both orders show up in the database as accepted, the inventory reads zero, and everything looks correct from the application's perspective. But the warehouse only has one unit, so one of those orders won't ship. The data lies cleanly, and the oversell stays invisible until a customer complains.

A CRDT-oriented merge model treats this differently. Instead of writing a new value, each region records its operation: Tokyo issued one decrement, Frankfurt issued one decrement. When the regions exchange state, the math applies both: 1 + (-1) + (-1) = -1. The inventory converges to -1, which is impossible in physical reality, and that impossibility is exactly the point. The negative count is a signal in the data that something needs attention. The application can flag the Frankfurt order, refund the customer, route the order to backorder, or whatever the business rule calls for. The bug doesn't have to wait for a complaint.

That doesn't mean every inventory rule is automatically solved. If your business logic depends on reserving stock before charging a card, or on routing orders to specific fulfillment centers, the application still owns those rules. But for the underlying replication problem, the difference is substantial: supported updates converge by design instead of colliding and waiting for one side to lose.

Where CRDTs fit (and where they don't)

The inventory counter is one example. The same logic applies anywhere multiple regions independently update something that has a sensible "combine" rule. Stock counts, vote tallies, like buttons, tag sets, audit logs, presence lists, telemetry counters. If the right answer to "what happens when two regions write at once?" is something other than "throw one away," CRDTs probably fit.

That's a strong fit for many real-time application patterns. Redis Cloud and Redis Software apply CRDT semantics in Active-Active for strings, hashes, lists, sets, sorted sets, streams, JSON, and HyperLogLog. The merge behavior varies by type: counters and sets converge through commutative operations, hashes merge at the field level, and strings fall back to LWW. The more naturally your workload maps to one of those mergeable types, the more naturally a CRDT-based replication model fits.

It isn't a universal answer, though. Data types outside that list don't get CRDT semantics in Active-Active, so a workload built around them may need a different replication strategy. Some workloads are also about preserving invariants that need tighter coordination, such as financial transfers or uniqueness constraints, where one update has to block, validate, or reject another before commit. Automatic convergence isn't the whole problem there, because the application cares about rules that exist above the level of the data structure. CRDTs don't replace consensus protocols. They're a fit for the subset of problems where merge semantics match the shape of the data.

Database

Take this into production

Use Redis to power real-time data, retrieval, and caching at scale.

Run active-active workloads on Redis

Active-active replication forces trade-offs between write latency, availability, and how you handle conflicting writes when two regions write to the same key. CRDTs change that calculus for supported data types by making convergence a property of the data structure itself. For workloads that fit the model, that's often a better path than naive Last Write Wins or paying inter-region coordination cost on every commit.

Active-Active Geo Distribution on Redis Cloud and Redis Software is built on CRDTs, with sub-millisecond local data operations and up to 99.999% uptime when deployed across multiple regions. If you're evaluating active-active replication for a globally distributed app, try Redis free to test multi-region writes in your own environment, or talk to our team about your architecture.