Using Atomic Transactions to Power an Idempotent API — Brandur Leach
What we've covered here works nicely for HTTP requests that are idempotent. That's probably a healthy majority given a well-designed API, but there are always going to be some endpoints that are not idempotent. Examples include calling out to an external payment gateway with a credit card, requesting a server to be provisioned, or anything else that needs to make a synchronous network request.
For these types of requests we're going to need to build something a little more sophisticated, but just like in this simpler case, our database has us covered. In part two of this series we'll look at how to implement idempotency keys on top of multi-stage transactions.
Read full article from Using Atomic Transactions to Power an Idempotent API — Brandur Leach
No comments:
Post a Comment