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

29 Request retrial

This chapter covers

  • How to decide which failed API requests are safe to retry
  • Advanced exponential back-off strategies for retry timing
  • How to avoid stampeding herds
  • Ways APIs can dictate retry timing for clients

When errors occur in web APIs, some of them are due to client mistakes, while others are due to issues outside the client’s control. Often the best solution to this second group of errors is to retry the same request at a later time in hopes of a different result. In this pattern, we’ll explore a mechanism by which clients can have clear direction in both how and when they retry requests that have previously failed due to errors on the API server.

29.1 Motivation

It’s an inevitable fact of web APIs that some requests ...

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