Course contentsShow
← System Design
Lesson 213 of 1,9196. Database Scaling: Read ReplicasFree lesson

Acceptable Lag Windows by Use Case

Determining tolerable lag thresholds based on application requirements, from real-time to analytics.

Acceptable Lag Windows by Use Case

What you'll learn: How to determine appropriate replication lag tolerances based on what your application actually needs.

The Core Idea

Not all applications need instant consistency across replicas. Some can tolerate seconds or even minutes of lag, while others break with milliseconds of delay. Understanding your acceptable lag window—the maximum delay your use case can handle—helps you make smart tradeoffs between performance, cost, and complexity.

Think of it like food delivery: a pizza needs to arrive within 30-40 minutes (acceptable window), but a medical emergency requires seconds. Same concept, different requirements.

Real-Time Applications (0-100ms lag tolerance)

Use cases: Financial trading, gaming leaderboards, inventory management, seat reservations

These applications require near-instant consistency. If a user books the last concert ticket, that data must be unavailable to others immediately. Reading from a lagging replica could cause double-bookings or race conditions.

Interactive Applications (100ms-2 seconds)

Use cases: Social media feeds, e-commerce product catalogs, user profiles, comment threads

Most user-facing features fall here. Users might see slightly stale data (like a comment count that's off by one), but the experience feels "real-time enough." A 1-second lag on your friend's new post is barely noticeable.

Dashboard and Reporting (2-30 seconds)

Use cases: Admin dashboards, metrics displays, search indexes

Business dashboards don't need split-second accuracy. Seeing statistics from 10 seconds ago is perfectly acceptable for monitoring trends.

Analytics and Batch Processing (minutes to hours)

Use cases: Data warehousing, business intelligence, historical reports, trend analysis

Analytics queries often run against dedicated replicas specifically to avoid impacting production. A 15-minute lag on yesterday's sales report? No problem.

Key Takeaway: Match your replication lag tolerance to your business requirements—real-time features need tight consistency (milliseconds), while analytics can tolerate minutes or hours of lag, allowing you to optimize for read performance instead.