top | item 38602886

(no title)

wayfinder | 2 years ago

The only reason I knew about idempotency is because growing up I was a little shit and I learned that you could break a LOT of electronics by getting it to do a second thing midway before finishing doing the first thing.

If it had a screen and buttons, I would try to break it.

So I started striving for highly reliable systems not because there are professional bad actors out there or spammers or to achieve high performance… but because there’s another little shit out there.

discuss

order

rmbyrro|2 years ago

> getting it to do a second thing midway before finishing doing the first thing

I'm not sure this is the kind of failure idempotency is design to tackle.

Idempotency tackles the issue of handling multiple requests for doing the same thing, isn't it?

weaksauce|2 years ago

> Idempotency tackles the issue of handling multiple requests for doing the same thing, isn't it?

yeah... there should be no extra side effect if you call something more than once on it with the same parameters. ie foo(x) is the same as foo(foo(x)) is the same as foo(foo(foo(x)))

or in networking GET x is the same as GET x followed by a GET x etc... the GET request doesn't (*shouldn't) change anything.

wayfinder|2 years ago

It gave me an intuitive understanding of state machines and idempotency is one solution to transitions.

If you start with State A and a call changes it to State B, what does running the call again do? A->B? But you’re already at B. Shit’s going to break. Redesign your system.