Engineering Decisions · Middle · Question 7 of 14
Checkout calls a recommendations service that sometimes hangs for 30 seconds. Recommendations are optional, while checkout must stay fast. What do you do?
- 1A long timeout with several retries on each failure
- 2Moving recommendations into the checkout service itself
- 3A short timeout with a fallback of no recommendations
Show the answer
Correct answer: A short timeout with a fallback of no recommendations
Explanation
An optional feature should never hold up the main flow, so a short timeout and an empty fallback keep checkout fast. Long timeouts with retries fit a dependency you truly can't work without, and here they would stack delays on top of a hanging service. Merging the services fits two parts that always change together, but it's a big rewrite and doesn't fix the slowness itself.