liveBook · Manning

Commutative operation

As explained in Think Distributed Systems

An operation whose result is unchanged when its operands or applications are reordered.

A commutative operation produces the same result when its applications are reordered. This property matters in distributed systems because concurrent components may receive requests in different orders. section 2.2

Reordering arithmetic requests

Starting from 0, two acceptors receive requests to add 2. Applying (+2) in either order produces the same result. By contrast, applying (+2) and (×2) can produce different results depending on order, so coordination becomes important. section 2.2

Figure 2.11 Proposers and acceptors
A black background with white circles

AI-generated content may be incorrect.

Compare how proposers broadcast operations and how acceptors can observe or apply them in different orders. section 2.2

How Think Distributed Systems covers it

How deep it goes
Defines commutativity through arithmetic examples and stops short of formal algebraic treatment or implementation details.
Examples
Uses two proposers, two acceptors, and (+2) versus (×2) requests applied to initial state zero.
What it assumes
Assumes basic arithmetic and introduces distributed components, message exchange, concurrency, and coordination through examples.
What you can do after
Evaluate whether reordered concurrent operations can produce consistent results across acceptors.
How it connects
Connects commutativity with distributed systems, event ordering, race conditions, concurrency, and coordination.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Think Distributed Systems. The section links point to the parts of the book it draws on.