> For the complete documentation index, see [llms.txt](https://isubasinghe.gitbook.io/isithas-wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://isubasinghe.gitbook.io/isithas-wiki/computer_science/distributed_systems/consistency.md).

# Consistency

## Basic idea

Consistency models specify what values reads may observe given concurrent writes. They are characterised by two orthogonal properties: *safety* (nothing wrong ever happens) and *liveness* (something good eventually happens).

## Key facts

* Strict linearisability: every op appears to take effect atomically at some point between invocation and response — strongest safety, no liveness gain.
* Sequential consistency: some total order consistent with each thread's program order.
* Eventual consistency: liveness only — replicas converge if updates stop.
* Strong eventual consistency: liveness + safety — replicas that have seen the same updates are in the same state.

Consistency in the context of distributed systems revolve around two things, safety and liveness.

## Eventual consistency

Makes promises about liveness only.

## Strong eventual consistency

Makes promises about liveness and safety

## Liveness

The property that eventually something good will happen. For example saying that a system will return a result to every API call is a liveness property.

## Safety

The property states that nothing bad will ever happen. For example never returning a wrong value or electing two leaders.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://isubasinghe.gitbook.io/isithas-wiki/computer_science/distributed_systems/consistency.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
