Skip to Content
API Design Patterns
book

API Design Patterns

by John J. Geewax
July 2021
Intermediate to advanced
480 pages
14h 40m
English
Manning Publications
Content preview from API Design Patterns

26 Request deduplication

This chapter covers

  • How to use request identifiers to prevent duplicate requests
  • How to manage collisions with request identifiers to avoid confusing results
  • Balancing caching and consistency of requests and responses

In a world where we cannot guarantee that all requests and responses will complete their journeys as intended, we’ll inevitably need to retry requests as failures occur. This is not an issue for API methods that are idempotent; however, we’ll need a way to safely retry requests without causing duplicated work This pattern presents a mechanism to safely retry requests in the face of failure in a web API, regardless of the idempotence of the method.

26.1 Motivation

Unfortunately, we live in a very uncertain ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Designing Web APIs

Designing Web APIs

Brenda Jin, Saurabh Sahni, Amir Shevat

Publisher Resources

ISBN: 9781617295850Publisher SupportOtherPublisher WebsiteErrata PagePurchase Link