Consistency Models

In this lesson, we will learn the different forms of consistency.

According to the CAP Theorem, consistency means that every successful read request will return the result of the most recent write. In fact, this is an oversimplification, because there are many different forms of consistency.

In this lesson, we introduce the forms of consistency that are most relevant to us.

To accurately define all these forms really, we need to build a formal model. This is usually the consistency model.

Consistency model

The consistency model defines the set of execution historiesA history is a collection of operations, including their concurrent structure (i.e., the order they are interleaved during execution). that are valid in a system.

In layperson’s terms, a model formally defines the behaviors that are possible in a distributed system.

Consistency models are extremely useful for many reasons:

  • They help us formalize the behaviors of systems. Systems can then provide guarantees about their behavior.
  • Software engineers can confidently use a distributed system (i.e., a distributed database) in a way that does not violate any safety properties they care about.

In essence, software engineers can treat a distributed system as an opaque box that provides a set of properties. Moreover, they can do this without knowing of all the complexity the system internally assumes to provide these properties.

A strong consistency model

We consider consistency model A stronger than model B when the ...

Access this course and 1400+ top-rated courses and projects.