Handling Eventual Consistency with Distributed Systems

Mario Bittencourt
SSENSE-TECH
Published in
9 min readMay 21, 2021

--

At SSENSE, we employ microservices to provide functionality for both our customers and back-office operators.

To operate at scale and provide resilience in a distributed environment, we leverage several patterns, including:

  • Using events to communicate changes (Event-Driven Architecture)
  • Using read models for specific access patterns (CQRS / Event Sourcing)
  • Using replication of data between persistence models (source/replica)
  • Using faster medium for frequently accessed data (caching)

The use of any of the methods above welcomes the fact that the systems are eventually consistent, which presents some challenges that are often overlooked by developers.

This article aims to discuss some of these challenges, while sharing potential approaches you can take to handle the eventual consistency aspect in your applications.

Defining Eventual Consistency

The term eventual consistency is used to describe the model, commonly found in distributed systems, that guarantees that if an item does not receive new updates, then eventually all accesses to that item will return the same value matching the last update, therefore providing a consistent result. Systems that present this behavior are also referred to as convergent.

--

--