liveBook · Manning

Idempotency

As explained in ScyllaDB in Action

Idempotency is the property of an operation whereby repeating it produces the same resulting state as performing it once.

Idempotency means that repeating an operation produces the same resulting state as performing it once. In ScyllaDB collections, this makes retries safer when a client times out but the database may have completed the request. section 4.5.2 section 4.5.1

Set operations demonstrate idempotency:

  • Adding existing values does not create duplicates. section 4.5.2
  • Adding the same values repeatedly leaves the set unchanged after the first update. section 4.5.2
  • Removing absent values has no effect, so repeating removal is safe. section 4.5.2

Why sets are safer than lists

A list update such as appending data or deleting by index can produce a different result when retried after a timeout. Replacing the entire list is safer. A set avoids this retry hazard through uniqueness and idempotent addition and removal, making it a better fit for a gallery of images. section 4.5.1 section 4.5.2

cqlsh:types> INSERT INTO collections(text, set_text)
  VALUES ('set', {'a', 'b', 'c', 'c'});

Insert duplicate set values and query the result to see duplicates removed without an error. section 4.5.2

How ScyllaDB in Action covers it

How deep it goes
Explains repeated set additions and removals, contrasts list mutation risks, and stops short of broader distributed-systems treatment.
Examples
Demonstrates duplicate insertion, repeated set updates, absent-value removal, list mutation, and image-gallery modeling.
What you can do after
Apply idempotent CQL set updates and choose sets over lists when retry safety and uniqueness matter.
How it connects
Connects idempotency with sets, lists, collections, uniqueness, retries, client timeouts, and data modeling.

Also explained in

Compare how 17 books explain idempotency →

Related concepts

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