Eventual Consistency vs Strong Consistency

Eventual Consistency

What is it?

  • Theoretical guarantee
  • If no new updates to an entity are made
    • All reads of the entity will eventually return the last updated value

Example of an eventual consistency model?

  • Internet Domain Name System (DNS)!
  • DNS servers are cached and replicated across directories over the internet
    • Time is needed to replicated modified changes to all DNS clients and servers
  • DNS is the foundations of the internet so it been a very successful system
  • It is has high availability and scalable
    • This has enabled name lookups for any device connected to the internet

Warning

  • Whilst availability is high on reads… replicas may be inconsistent with the latest write on the originating node

Strong Consistency

What is it?

  • Traditional relational databases have been designed based on this concept of strong consitency
  • Also called immediate consistency
  • Means that data is viewed immediately after an update
    • Therefore, all observers of the entity will be consistent

Trade offs

  • To have strong consistency… scalability and performance are compromised!
  • Data would required locking during the period of updates or replication process (replication lag)
    • To ensure that no other processes are updating on the same data

One response to “Eventual Consistency vs Strong Consistency”

  1. What are Monotonic Reads? – Scalable Human Avatar

    […] this method is a weaker guarantee than strong consistency, but a stronger guarantee than eventual consistency. For more readings on strong consistency vs […]

    Liked by 1 person

Leave a comment

I’m Sean

Welcome to the Scalable Human blog. Just a software engineer writing about algo trading, AI, and books. I learn in public, use AI tools extensively, and share what works. Educational purposes only – not financial advice.

Let’s connect