A Cloud Run aggregator calls pricing, inventory, and shipping APIs for every page view. The pricing API occasionally takes 20 seconds, which exhausts the request time budget and holds up the other calls. What design change best contains that risk?
Show answer and explanation
Answer: D
Independent downstream calls can run concurrently, so one slow dependency does not serialize the whole request. A per-call timeout caps how long any single dependency can hold the response, which protects the overall deadline. If pricing is slow, the page can render with a fallback for that section instead of failing outright. Sequential calls and removed deadlines both make slowness worse.
Why the other options are wrong
- A. Sequential calls add each dependency's latency together, so a slow pricing call still consumes the budget before the others start. Giving each call the full budget is what causes the blocking.
- B. Without timeouts, a slow call can hold a request open until the platform kills it. That turns a partial slowdown into full request failures.
- C. A single worker thread serializes all calls and removes the concurrency that would isolate the slow dependency. It makes the aggregator slower overall.