Hacker News new | ask | show | jobs
by yuvadam 1385 days ago
Why? What happens if I update the invoice address twice?
2 comments

Working on an ERP software atm, A lot. Often invoices HAVE to be immutable for accounting purposes, so changing the address has to keep an old copy around for the old invoice, while attaching it to any new ones/ones not printed yet. Along with that, some other data may be tied to that address that cant be changed. Like tracking a package in transit that has been sent to the old address.

Idempotency is a godsend for such actions.

If that is all there is to it, then the op is idempotent.

If on the other hand, there is a side effect such as modifying the last_updated column then it isn't and should be coded appropriately.