Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is duduping same as idempotency

It's clear for me what idempotence means based on this Defining Idempotence

But I also heard a lot people describe such behavior as deduping. Is that an equivalent terminology?

For example, if an API is idempotent that same request being processed for N times will get the state same as one time. Can I say that API is deduping requests?

like image 715
Long Quanzheng Avatar asked Nov 03 '25 00:11

Long Quanzheng


1 Answers

The two terms are not equivalent, though it may be helpful for people unfamiliar with idempotency to think of it initially based on its similarity to deduplication.

For a contrasting example, consider an API for a bank account which accepts a positive or negative number by which to adjust the account balance (deposit or withdrawal). Clearly this API is not idempotent, because consecutive transactions have a cumulative effect.

On the other hand, we would certainly want to deduplicate these transactions. If transaction #123 is (erroneously) submitted twice, it should apply to the account balance only once. In this case, transactions should be deduplicated because the API is not idempotent.

Deduplication is an activity: an action to perform. Idempotency is an attribute: a property to describe. A similarity exists between the two when the result of deduplication is the same as the effect of idempotency; that is, no change in state. But an equivalent outcome does not make the two terms equivalent.

like image 93
jaco0646 Avatar answered Nov 05 '25 02:11

jaco0646



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!