Course contentsShow
← Computer Science
Lesson 2624 of 2,87258. Distributed Systems BasicsFree lesson

Choosing the Right Consistency Model

Understand how to select an appropriate consistency model based on application requirements and constraints.

Choosing the Right Consistency Model

You'll learn: How to match your distributed system's consistency guarantees to your application's actual needs and trade-off tolerance.

The Decision Framework

Picking a consistency model isn't about choosing the "best" one—it's about choosing the right one for your specific requirements. Think of it like choosing a shipping method: overnight delivery (strong consistency) is expensive and sometimes unnecessary when standard shipping (eventual consistency) will do.

Key Factors to Consider

Application Requirements

Can users tolerate stale data? Social media likes can be eventually consistent—users won't notice a 2-second delay. Bank account balances require strong consistency—you can't allow overdrafts due to stale reads.

Do operations need ordering guarantees? If event ordering matters (chat messages, collaborative editing), consider causal consistency. If operations are independent (analytics counters), eventual consistency suffices.

Performance vs Guarantees

Stronger consistency models require more coordination:

  • Linearizability ensures every read sees the latest write but requires cross-datacenter coordination (high latency)
  • Eventual consistency allows fast local reads/writes but users might see temporarily inconsistent views
  • Causal consistency balances both: preserves meaningful order without full synchronization

User Experience Needs

  • Session consistency ensures one user sees their own writes—critical for shopping carts and user profiles
  • Monotonic reads prevent users from seeing data "go backward in time"
  • Choose based on what would confuse or frustrate your specific users

Availability Requirements

During network partitions, stronger models (CP systems) may reject requests. If you need 24/7 availability, lean toward AP systems with weaker consistency.

Key Takeaway: Choose consistency models by analyzing your application's tolerance for stale data, required ordering guarantees, latency sensitivity, and availability needs—stronger isn't always better when weaker models meet requirements at lower cost.