How do we avoid cases where losing an ACK could lead to users doing an action multiple times (e.g. pressing the like button)? Idempotence!
is idempotent if
- Not idempotent:
Idempotent requests can be retried without deduplication.
However, this isn’t perfect when there are other actors/actions that intermix. For example, but (e.g. liking, unliking, then liking is not the same as unliking!)
To somewhat fix this, use tombstones and record logical timestamp for when events happen
- Then, we can reconcile replicas by propagating the record with the latest timestamp and discard the records with earlier timestamps
- Then, to fix concurrent writes by different clients