← Back to microservices patterns map
⏱️
Microservices Pattern

Timeout Pattern

Never wait forever for an outgoing call.

timeout

Detailed Description

Timeouts cap how long resources are tied up waiting for dependencies.

Set timeouts based on real latency data and overall request budget.

Visual Diagram

Call starts
Deadline set
No response by deadline
-> fail fast

Tradeoffs

Pros

Predictable behavior, frees stuck work

Cons

Too short causes false failures

Examples: fetch AbortController, axios timeout, gRPC deadline