5 ms·
One Serverless Principle to Rule Them All: Idempotency [video]
- zmgsabst 4y agoWhat does idempotency have to do with serverless? That seems more like a general systems principle.
- zoover2020 4y agoEvent-driven architecture going haywire, think S3 --> Lambda recursion
- zmgsabst 4y agoRight — I understand why idempotency is a good idea. What makes this “serverless” rather than just good design, even if your API is on a traditional server?
- ldoughty 4y agoFailure rate is higher in cloud severless than on transitional machines or in VMs... Especially since many people do not do the extra steps necessary to skip going too the edge of the cloud provider and back in.. do they often go through additional services that can break that make never would when the requests are on the same box. We see something like .0001% failure rate with API gateway behind custom DNS, and supports response was "this is in SLA, try adding retry code" (which needs idempotency). So we have to do extra engineering, including idempotency and bypassing API gateway in some cases, to mitigate the issue.
- layer8 4y agoYou are completely right, it has nothing specifically to do with serverless.
- barbazoo 4y agoThey go into it a little bit by referring to AWS' 7 principles of well architected applications one of which is being event driven. From experience my gut feeling is a large number of services running on servers PaaS are event driven, therefore it's important to build them to be idempotent beause of the "at least once" property of many messaging systems.
- westurner 4y agox ° x = x Idempotency > Computer science meaning https://en.wikipedia.org/wiki/Idempotence#Computer_science_meaning https://en.wikipedia.org/wiki/Idempotence#Computer_science_m... > Idempotence is the property of certain operations in mathematics and computer science whereby they can be applied multiple times without changing the result beyond the initial application. The concept of idempotence arises in a number of places in abstract algebra (in particular, in the theory of projectors and closure operators) and functional programming (in which it is connected to the property of referential transparency).
- westurner 4y ago"A comparison of idempotence and immutability" [immutable infrastructure] https://devops.stackexchange.com/questions/2484/a-comparison-of-idempotence-and-immutability https://devops.stackexchange.com/questions/2484/a-comparison... Ansible Glossary > Idempotency https://docs.ansible.com/ansible/latest/reference_appendices/glossary.html#term-Idempotency https://docs.ansible.com/ansible/latest/reference_appendices... : > Idempotency: An operation is idempotent if the result of performing it once is exactly the same as the result of performing it repeatedly without any intervening actions
- ldoughty 4y agoIn my work in severless, we see 10-40 (known) dropped requests power day. I highlight known because many requests fail with transient network errors that never make it to our logs, and others fail somewhere in the cloud provider black box before we get a log, but the caller gets a response from the cloud providers load balancer. While 10-40 is not a lot in the scale of hundreds of thousands of requests per day (were not that large), when that request is a write event, that's very detrimental to customer perception/experience... It might even cost your business money (failing to turn off/delete something)... And the easy answer of "retry the request" fails with write events that are not idempotent... WHEN should you retry? A gateway error doesn't necessarily mean the back end didn't get the request.. just that your didn't get a response. It's even worse when what you'd expect to be internal communication has this same failure rate.. your back end processes getting a random 504 gateway error in places it never happened before.. breaking longer running processes.
- zo1 4y agoWelcome to the cloud. It has so many oddities and overall crappiness that's been excluded from all the marketing content. Places where you can engineer wrongly or shoot yourself in the foot. Sorry low effort response, I'm on a phone. But my experience resonates with your comment a lot!
- jagged-chisel 4y agoIt would be nice to have a transcript. Video description: ----- When it comes to serverless applications one principle rules them all: idempotency. This ability to rerun a function, make a REST API call, or process a message any number of times and ensure the same result is extremely hard to do reliably. In this talk, I’d like to explain and explore the importance of idempotency and discuss how we can implement it in our own systems, including: 1. Idempotency’s relationship with good serverless architecture. 2. How safe retries are impossible without idempotency. 3. Examples of serverless frameworks and tools that help/encourage idempotency. You’ll leave this talk with a deeper understanding and appreciation for this tongue-twisting principle and start combing through your code with an idempotent eye.
- barbazoo 4y ago> It would be nice to have a transcript. I find text so much more accessible than video. Rarely have I seen a video that couldn't have been a bunch of slides or a blog post. Unrelated to this video here, I started to wonder if that's why a lot of the content that tends to be associated with conspiracy theories or regarded disinformation is in the form of video and not text. Video is just so much harder to scrutinize and reason about because it's so difficult to reference specific arguments when they're talked about and not written down.
- remotesynth 4y ago
- modeless 4y agoYouTube has transcripts now. On desktop, in the ellipsis menu under the video title on the right. On mobile, a "show transcript" button after expanding the video description. They're not exactly formatted for nice reading, but on desktop it's possible to copy and paste the whole transcript wherever you like. I find the speech recognition astonishingly accurate. Of course you will still find mistakes, but overall it is almost always possible to get most of a video's content much faster just by reading the transcript.
- low_tech_punk 4y agoI'm confused by the pronunciation. Does British English puts the emphasis on "idemPOTENCY" while American English puts the emphasis on "IDEMpotency"?
- layer8 4y agoThere is no consistent usage: https://english.stackexchange.com/questions/323013/is-there-a-correct-pronunciation-for-the-word-idempotent https://english.stackexchange.com/questions/323013/is-there-...
- walthamstow 4y agoEven weirder: my head of engineering, an Englishman, pronounces it I.D.M-potency
- adnan7860 4y ago
- politician 4y agoThe reasons for teams to choose serverless approaches (easy, “no devops”, frontend languages on the backend) seems culturally incompatible with the sort of truly hard up-front design work required to make operations idempotent. For example, it’s not trivial to avoid duplicates when handling HTTP POST operations in the presence of retries under load conditions even with a relational ACID compliant database supporting the effort. So, while I find myself adamantly in agreement with the presenter —- idempotency is great, I don’t have much hope for the broader adoption of these ideas in driving meaningful improvements towards correctness. Serverless systems seem fated to approach Excel workbook levels of accuracy- it’ll work most of the time. With the exception of things that can be trivially idempotent like pure referentially transparent functions and ffmpeg/image processing, of course.
- doliveira 4y agoI was reading the Expanse books and one thing that drew my attention is how easy and seamless they do data syncing over hours of light delay, asynchronous data updates, inter-operability... No way it would with our CRUDs and current SQL databases and programming languages
- plumeria 4y agoWhat are the Expanse books in this context?
- __warlord__ 4y agoThe Expanse is a series of science fiction novels https://en.wikipedia.org/wiki/The_Expanse_(novel_series) https://en.wikipedia.org/wiki/The_Expanse_(novel_series)
- pbhowmic 4y agoIdempotency is great to have and almost always non existent. It is just infuriating as a dev to keep coming across this mirage of an idea. I don’t get to reprocess the same bill twice without bad consequences. I don’t get to ship the same order twice.
- Taniwha 4y agoThat's why you have unique invoice numbers - it converts the (paper) protocol into an idempotent one
- HideousKojima 4y agoYou need more than just a unique invoice number, you need a unique identifier for any actions that can modify an invoice.
- dmitriid 4y agoThe dunning chain is dark and full of terrors. It's more Kafka (append-only log of unique operations) than some Platonic idea of idempotent operations.
- yuvadam 4y agoWhy? What happens if I update the invoice address twice?
- sorokod 4y agoIf 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.
- Akronymus 4y agoWorking 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.
- pcblues 4y agoCould I be right to say idemslopency is another excuse for a lack of practical and useful experience that gets jobs done? I'm olde.
- Arbortheus 4y agoI don't think this is necessarily exclusive to Serverless, rather any event-driven architecture. I work with a mostly event-driven (via GCP Pub/Sub) microservices backend, and adopting statelessness and idempotency where possible massively simplifies application logic. Without idempotency your transient error retry logic becomes really complicated. You need to handle which stage(s) have completed successfully and which failed, which then makes your service stateful. All this complexity comes from a lack of idempotency, if you can get rid of that, you could just Nack the message and let Pub/Sub retry it automatically with exponential backoff.
- sorokod 4y agoIdempotency is a desirable feature whenever a "no more then once" semantics are desirable, pretty much always in my multi service world.
- eezing 4y agoWho cares what it means, is she saying?: I-dem-puh-tin-see