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

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
小众软件
小众软件
博客园 - 三生石上(FineUI控件)
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园_首页
Last Week in AI
Last Week in AI
美团技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Apple Machine Learning Research
Apple Machine Learning Research
WordPress大学
WordPress大学
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - Franky
The Cloudflare Blog
罗磊的独立博客
月光博客
月光博客
N
Netflix TechBlog - Medium
C
Check Point Blog
Microsoft Security Blog
Microsoft Security Blog
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Microsoft Azure Blog
Microsoft Azure Blog
IT之家
IT之家
Jina AI
Jina AI
J
Java Code Geeks

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Strong vs Eventual Consistency in System Design
Samuel Owola · 2026-05-02 · via DEV Community

Why does this matter in distributed systems and why you should know this?

Modern software systems are rarely contained on a single machine. They are spread across multiple servers and regions to ensure they stay fast and reliable for users everywhere.

This distribution is a powerful tool, but it creates a challenge. When you have multiple copies of your data stored on different servers, you have to decide how to keep those copies in sync. This is the "consistency" problem.

How you handle this determines how your system behaves when things get busy or when the network fails. As a developer or architect, you must choose your consistency model intentionally. If you don't, the system will choose for you, and usually at the most inconvenient time.

What Consistency Really Means

In a distributed system, consistency is about timing. It answers the question: "After I save a piece of data, how soon will everyone else see the update?"

Think of it like a group chat.

  • Strong Consistency: Everyone in the chat sees every message in the exact same order at the exact same time. No one can reply to a message they haven't seen yet.
  • Eventual Consistency: Some people might see messages a few seconds later than others. Eventually, everyone sees the same history, but for a moment, the "truth" looks different depending on who you ask.

Choosing between them is not purely technical. It is a business decision with architectural consequences.

This article helps you understand how these models work, what trade-offs they impose, and how to choose intentionally without over-engineering or under-protecting your system.

Note: This is not the same as ACID consistency in single-node databases.
ACID consistency means the database moves from one valid state to another.
Distributed consistency is about when and where changes become visible.


Strong Consistency: The "Single Source of Truth"

Strong consistency guarantees that once you write data, every subsequent read will return that new value. It doesn't matter which server the user connects to. They will always get the latest version.

Diagram illustrating Strong Consistency - Image credit goes to GeeksforGeeks

How It Works

Strongly consistent systems typically rely on:

  • A leader or primary node that orders writes
  • Synchronous replication to replicas
  • Quorums that require majority agreement before success

A write is not considered successful until the system can guarantee that any subsequent read will see it.

This often means:

  • Writes must wait
  • Reads may block
  • Network partitions reduce availability

Correctness is preserved.

Real Use Cases of Strong Consistency

These are places where showing the wrong data even briefly causes real damage.

  • You send money

    Bank transfers, wallet balances, payment confirmations. If your balance is wrong for even a moment, trust is gone.

  • You buy the last item

    E-commerce stock, flash sales, ticket booking. Two people cannot buy the same last seat.

  • You lose or gain access

    Logging in, role changes, permission updates. If access is revoked, it must be revoked everywhere immediately.

  • You hit a usage limit

    API rate limits, subscription caps, quotas. Users must not exceed what they paid for.

  • You flip a critical switch

    Feature flags, kill switches, security toggles. Partial rollout can break production fast.

The Benefits

  • Predictability: The system behaves exactly like a single-node database.
  • Safety: You never have to worry about a user seeing an "old" version of their bank balance or a deleted password.

The Trade-offs

  • Speed: The system is slower because it has to wait for multiple servers to agree.
  • Availability: If one server is down or the network is lagging, the whole update might fail. The system chooses "Correctness" over "Being Online."

Eventual Consistency: The "High Speed" Approach

Eventual consistency allows different servers to hold different versions of the data for a short window of time. The system promises that "eventually," all copies will be the same, but it doesn't wait for that to happen before finishing your request.

How It Works

When you save data, the system records it on one server and immediately tells you "Success." It then copies that data to other servers in the background. For a few milliseconds, or sometimes seconds, a user on the other side of the world might still see the old data.

Diagram illustrating Eventual Consistency - Image credit goes to BytebyteGo

Eventual consistency relies on:

  • Asynchronous replication
  • Background synchronization
  • Conflict resolution strategies

The system prioritizes availability, low latency, and partition tolerance.

Stale reads are possible, but the system remains responsive.

Real Use Cases of Eventual Consistency

These are places where being slightly wrong for a while is invisible or acceptable.

  • You refresh your feed

    Social posts, likes, comments. Seeing an update a few seconds late does not matter.

  • You open an analytics dashboard

    Metrics, charts, reports. Near-real-time is good enough.

  • You get recommendations

    Suggested products, videos, content. Stale recommendations rarely cause harm.

  • You search for something

    Search indexes often lag behind writes. Users expect this.

  • You receive notifications

    Emails, push notifications, background jobs. Reliability matters more than immediacy.

The Benefits

  • Performance: It is incredibly fast because there is no waiting for coordination.
  • Resilience: Even if half the servers are having trouble communicating, the system can still accept new data and serve users.

The Trade-offs

  • Confusion: Users might refresh a page and see an old comment or an outdated notification.
  • Complexity: As a developer, you have to write code that can handle "conflicts" if two people update the same thing at the same time on different servers.

Eventual vs Strong Consistency in Practice with DynamoDB

DynamoDB is eventually consistent by default, meaning reads may return stale data immediately after a write.

You can explicitly request strong consistency on a read to guarantee the latest committed value.

This choice trades lower latency and higher availability for correctness, and you make it per request.

await dynamodb.put({
  TableName: "Users",
  Item: {
    userId: "42",
    email: "new@email.com"
  }
});

Enter fullscreen mode Exit fullscreen mode

The write succeeds, but replicas may not all be updated yet.

Eventual Consistency (Default)

await dynamodb.get({
  TableName: "Users",
  Key: { userId: "42" }
});

Enter fullscreen mode Exit fullscreen mode

You may receive stale data if the read hits a replica that has not applied the latest write.

Strong Consistency

await dynamodb.get({
  TableName: "Users",
  Key: { userId: "42" },
  ConsistentRead: true
});

Enter fullscreen mode Exit fullscreen mode

You are guaranteed to receive the latest committed value, at the cost of higher latency and throughput usage.


Making the Right and Intentional Choice

When you design your next feature, ask yourself: "What is the worst thing that happens if a user sees data that is five seconds old?"

If the answer is "nothing much," choose eventual consistency and enjoy the extra speed. If the answer is "we lose money or trust," stick with strong consistency.

Strong consistency prioritizes correctness over availability.
Eventual consistency prioritizes availability and scale over immediacy.

By being intentional with these trade-offs, you build systems that are not just technically sound, but also aligned with what your users actually need.