liveBook · Manning

Consistency

As explained in Elixir in Action, Third Edition

Consistency is the property that a system's observed state and operation outcomes remain coherent according to its intended rules.

Consistency keeps observed state and operation outcomes coherent with system rules. Assigning one to-do list to one server process eliminates races and keeps updates serialized. Process calls strengthen consistency because the caller receives a response, while casts favor responsiveness but provide no delivery or outcome guarantee. section 7.4

Calls versus casts

Use a call when the client needs confirmation or when synchronization matters. Use a cast when nonblocking responsiveness matters more and the caller can tolerate uncertainty about whether the request arrived or succeeded. Calls can also apply back pressure by preventing a client from producing work faster than the server handles it. section 7.4

a_tuple = {a, b, c}
new_tuple = put_elem(a_tuple, 1, b2)

Immutable updates preserve prior data versions, supporting atomic in-memory transformations and consistent intermediate state. section 2.4.5

How Elixir in Action, Third Edition covers it

How deep it goes
Explains process ownership and call-cast trade-offs, but stops short of formal consistency models or distributed guarantees.
Examples
Uses per-list to-do servers, a to-do cache, database workers, and immutable tuple transformations.
What it assumes
Assumes familiarity with concurrent processes and introduces consistency through server ownership and message patterns.
What you can do after
Apply it via process calls, casts, and ownership boundaries to balance confirmation, responsiveness, and back pressure.
How it connects
Connects process isolation with server processes, race conditions, calls, casts, back pressure, and immutability.

Also explained in

Compare how 20 books explain consistency →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Elixir in Action, Third Edition. The section links point to the parts of the book it draws on.