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
















