Java Zero to All All questionsPractise free
Interview questions › Distributed Systems & Messaging › Microservice Patterns & Architecture

How do you handle a request that needs data from five services without killing tail latency?

Level III · MidMicroservice Patterns & Architecture
Short answer

Synchronous fan-out chains multiply latency and failure probability, so aggregate behind an API gateway or a BFF and issue the calls in parallel rather than sequentially, with per-call timeouts and breakers.

Explanation

Better still, avoid the fan-out at request time: precompute a read model (CQRS) updated asynchronously from each service's events so the read is a single local lookup. Where you must call live, degrade gracefully — return partial responses with the non-critical services' data omitted rather than failing the whole request when one slow dependency times out.

Common mistakes
  • Calling the five services sequentially.
  • Calling them without timeouts or fallbacks.

Can you say this out loud in two minutes? Drill it in a timed mock interview, with flashcards and runnable code for Microservice Patterns & Architecture.

Practise free

More on Microservice Patterns & Architecture