Failure ModesLong read

Replication Lag and Read-After-Write Inconsistency in Distributed Storage

Async replication creates windows where reads return stale data before replicas catch up.

Columnist · · 10 min read
Cover illustration for “Replication Lag and Read-After-Write Inconsistency in Distributed Storage”
Failure Modes · September 23, 2026 · 10 min read · 2,176 words

Replication lag is the delay between a write hitting the primary copy of your data and that write showing up everywhere else it's supposed to live. Read-after-write inconsistency is what happens when someone reads from one of those other spots before it's caught up. One's the engineering term, the other's the user complaint, and they're describing the same event.

The standard setup is leader-follower: one node takes writes, a pile of others take read traffic to spread the load. That split is why lag exists. Followers follow. They don't get to see the future before the leader tells them about it.

Why async replication creates the inconsistency window

A primary that waits for every replica to confirm a write before telling the client "done" is slow, so almost nobody builds it that way. Most systems acknowledge the write the moment it's durable on the primary, then ship it to replicas in the background, on its own schedule. The client gets a fast response. The replicas get the update whenever they get around to it.

That gap, between acknowledged and actually propagated, is the whole ballgame. Anyone reading from a replica during that gap gets old data, and the system won't flag it as an error, because nothing technically broke.

Cross-device use makes it worse. Someone updates a profile picture on their phone, then checks their laptop ten seconds later. The phone's connection routed to one datacenter, the laptop's routed to another, and there's no guarantee datacenter B has heard from datacenter A yet. New objects tend to close that window fast. Overwrites of existing objects are the real offenders: propagation can take seconds or, in the uglier cases, minutes that nobody wants to account for in a status meeting.

The spectrum of consistency guarantees and their costs

Consistency is a dial, not a switch, and most engineers reach for the wrong setting because they think in absolutes instead of asking what the read actually needs.

Strong, synchronous consistency means the primary won't say "done" until all replicas, or a quorum, confirm. No stale-read window, full stop. The bill comes due in latency: every write waits on the slowest replica in the room, which makes this a bad default for anything read-heavy.

Eventual consistency flips that. The primary acknowledges immediately, replicas catch up on their own time. Fastest writes available, but the inconsistency window stays open for an unpredictable stretch, and "eventual" is doing a lot of quiet work in that sentence.

Read-after-new-write, sometimes called almost-strong, splits the difference by treating writes and reads differently instead of picking one setting for both. The write goes in cheap, at a low consistency level, to keep speed up. The read comes back expensive, at a higher consistency level that forces reconciliation before it answers. Write speed stays intact, and the read that follows is still reliable, without paying for full synchronous replication on every single operation.

Some systems apply that dial per operation instead of picking one global setting. Hybrid consistency object storage (HCOS), for instance, uses strong consistency for read-after-create, where there's no ambiguity about which version of a brand-new object you mean, and eventual consistency for read-after-overwrite, where changes to an existing object are allowed to trickle in. That's the tell that consistency doesn't have to be a single knob for the whole system. It can be a policy, applied differently depending on what kind of write just happened.

Real products make the choice explicit rather than hiding it. Azure Cosmos DB ships five named consistency levels, strong down to eventual, and lets the developer pick. Session consistency is the one most people actually use, and Cosmos DB backs it with 99.999% availability when data spans multiple regions with multi-region writes turned on. Google Cloud Spanner bets the other way, hard, on external consistency enforced through TrueTime synchronization, a guarantee stronger than standard linearizability, while still holding 99.999% availability. Same dial, opposite bets, and both companies are right for their own workload.

S3's 2020 consistency pivot and what it changed for developers using object storage

For years, S3 was the textbook case of eventual consistency at scale. Write an object, and there was a window, sometimes brief, sometimes not, where the data sat safely stored but wasn't guaranteed visible to the next GET request. Engineers built entire workaround patterns around that fact: extra caching layers, "wait a beat before reading" logic, defensive retries. It was just the tax you paid for object storage that could scale that wide, and everyone paid it without much complaint.

Then, in December 2020, Amazon flipped it. S3 delivers strong read-after-write consistency automatically now, for every application, on every operation: GET, PUT, LIST, tags, ACLs, metadata, all of it. No opt-in, no upcharge, no performance penalty. That's the baseline today, not an upgrade tier.

The mechanism behind it is that writes get coordinated across multiple replicas and metadata stores before the write is ever reported as successful. The acknowledgment itself only fires once subsequent reads are guaranteed to see it. Distributed consensus is doing the work up front, not background replication scrambling to catch up after the fact.

LIST operations got folded into that same guarantee too. Write an object, list the bucket, see the object, immediately. That matters more than it sounds like it should, because plenty of pipelines don't track object keys themselves. They just list a bucket and process whatever shows up. Before 2020, that pattern was a trap waiting to spring. Now it isn't, and that single change quietly rewrote a lot of assumptions engineers had baked into their pipelines without realizing it.

Diagram: The Consistency Dial: Five Settings and Their Trade-offs. Visualizes: Show a spectrum or ranked scale of consistency levels from weakest to strongest, illustrating the write-speed vs.

Four practical mitigations engineers reach for when they cannot afford stale reads

Not every system gets to be S3. Plenty of engineers are stuck running Redis replicas, database followers, or homegrown leader-follower setups where the inconsistency window is alive, well, and occasionally biting someone. Four patterns appear repeatedly.

Routing critical reads back to the primary is the blunt instrument. After a write, flag that the next read for that specific key or user should skip the replicas and hit the primary directly. In Redis, that might mean setting a short-lived key, read_primary:{user_id}, that expires after one second, and having reads check for that flag first. It's simple and it works, but it concentrates load right back on the primary for exactly the operations already stressing it, so it falls apart as a blanket policy.

Reading only from replicas that have actually caught up is the more scalable version. Measure lag continuously and skip any replica too far behind. Redis exposes this through INFO replication, comparing the primary's offset against each replica's offset in bytes; cross a threshold, and that replica gets skipped for reads. If every replica is lagging, fall back to the primary. The same logic generalizes past Redis to any leader-follower system where lag is a number you can actually watch in real time.

Forcing a synchronous acknowledgment works for the writes that matter most, and only those. Redis's WAIT 1 500 command blocks until at least one replica confirms the write or 500 milliseconds pass, whichever hits first. Raft and Paxos-based systems formalize the same idea as quorum writes, where W out of N nodes have to sign off before the write counts as done. It costs latency on every write it touches, so it belongs on the writes where staleness genuinely isn't an option, not as a default setting.

Carrying a version number forward is the cleverest of the four, because it gets correctness without routing every read through the primary. The primary stamps each write with a unique, increasing version number and hands it to the client. Next time that client reads, it includes the version number, and the server makes sure it's processed everything up to that point before answering. It's a fencing token, and the replica only catches itself up on the version that specific client actually needs, not the whole backlog.

Quorum and any-local-quorum as consistency mechanisms for multi-site deployments

Diagram: GPU Utilization vs. Data Stalls: The AI Infrastructure Gap. Visualizes: Show the stark magnitude contrast between what AI hardware costs and how little it is actually used, using three concrete figures.

Quorum reads flip the model from "ask the primary" to "ask everyone and compare." A router checks metadata, version numbers, log sequence numbers, across every healthy node, then sends the read to whichever node is at or past the offset the request needs. No single node holds authority. The system just needs enough of them to agree.

Multi-site deployments add a real wrinkle: cross-datacenter round trips are expensive, and nobody wants that latency sitting on the critical path of every write. Any-local-quorum solves it by routing the request to a local quorum within a single datacenter rather than requiring agreement across sites, keeping cross-site latency off the write-acknowledgment path.

AWS offers a useful benchmark here. Aurora Global Database can hit sub-second replication latency between a primary region and a secondary region under good conditions, supporting cross-region failover in under a minute. That's what purpose-built replication infrastructure buys when the stakes are "an entire region just fell over."

Even quorum has a blind spot, though, and pretending otherwise is how people get burned. There's a moment mid-write where an intermediate state is visible on fewer than a majority of nodes, technically inconsistent, just not caught yet. Cohesity's patent (US 10,671,482) handles this by writing an intent indicator to a minority of nodes first, then committing to the majority afterward, so any read resolves to the latest majority-confirmed value instead of catching the system mid-thought.

Replication lag in AI training infrastructure: from correctness problem to throughput problem

Everything above treats stale reads as a correctness bug: wrong answer, unhappy user, annoyed engineer paged at 2am. In AI training infrastructure, the same lag burns compute instead of correctness, and the dollar figures make it a far louder problem to ignore.

Global AI infrastructure spend reached into the hundreds of billions of dollars in 2025, with storage and networking scaling up nearly as fast as compute. And yet a large share of organizations report that data and storage bottlenecks are actively limiting AI performance, and a majority say their data isn't even AI-ready to begin with. An IDC survey of over 1,300 AI decision-makers found 48% naming data quality, consistency, and governance as the single biggest barrier between them and the outcomes they're paying for.

That is visible on the ground as GPUs sitting idle, which is the most expensive kind of idle there is. Cast AI looked at tens of thousands of clusters and found average GPU utilization across AI and ML workloads is just 5% (CPU at 8%, memory at 20%). That's a fleet of extremely expensive chips mostly doing nothing, and the bill still arrives every month regardless. That's a fleet of extremely expensive chips mostly doing nothing, and the bill still arrives every month regardless.

Meta's numbers explain why. The company found that a majority of GPU cycles, reported at 56%, stalled out, waiting on training data to show up. Meta stores exabytes of data in Tectonic, its internal storage system, but keeping petabyte-scale datasets continuously available to the hardware that needed them proved a significant architectural challenge. The fix was Meta's Data PreProcessing Service (DPP), built specifically to eliminate data stalls across datacenter-scale training clusters fed by that exabyte-scale storage. On the hardware side, a setup achieving 720 GB/s of throughput from just 8 storage nodes feeding 768 H100 GPUs shows what it actually takes to keep chips fed instead of waiting around doing nothing at full price.

How a filesystem interface over object storage changes agents' and training pipelines' encounters with these problems

Object storage is a genuinely good architectural fit for AI workloads. It scales horizontally without much drama, handles massive parallel access without blinking, and decouples compute from storage so neither one waits on the other's lifecycle.

The interface is where it falls apart for practical use. Bash scripts, POSIX file paths, atomic rename, append, mmap: an entire universe of existing tooling assumes a filesystem, and object storage doesn't speak that language natively. Pointing an agent or a training pipeline straight at raw object storage means a rewrite, or an abstraction layer sitting in between translating filesystem calls into object operations.

That's where a filesystem layer over object storage earns its keep, and specifically on the consistency side. Done right, writes replicate before the layer ever hands control back to the caller, while the object store underneath stays the actual source of truth. What the agent or training job gets is a workspace that reads back what it just wrote: no propagation window to trip over, none of the "did that actually land yet" guesswork that used to define raw object storage.

That distinction matters more now, because the thing reading and writing isn't always a human anymore. An agent operating across multiple sessions, reading, writing, executing, picking back up hours later, needs the same basic guarantee a person expects at their desk: what got written last session is actually still there next session. Stripping away the framing reveals read-after-write inconsistency again, just in a new outfit, standing in the same line at the same AI infrastructure party it's always been at.

Sources

  1. 10671482
  2. Read-After-Write Consistency Challenge in Read Replicas | by Rurutia1027 | Medium
  3. How to Handle Redis Replication Lag in Applications
  4. Replication Lag in Distributed Systems - GeeksforGeeks
  5. Replication Lag and Read Consistency in Distributed Systems | by Rahul Jindal | Medium
  6. aws.amazon.com
  7. The Replication Lag Question That Shows Up in Most Senior Interviews
  8. introl.com
Filed underFailure Modes

More in Failure Modes