A platform team wants to add a gateway aggregation layer in front of every microservice so that all clients only ever talk to one aggregation endpoint. What are the costs of this approach, and in what situations is gateway aggregation the wrong tool?
answer
- extra hop equals extra ownership cost
- latency floor equals slowest call
- god-gateway anti-pattern
- fine when caller and callee are far apart, wasteful when already close
- diverse clients need per-client BFFs, not one big aggregator
basics
~20 sAggregation adds an extra hop, an extra thing to build, run, and version, and makes the whole response only as fast as the slowest call inside it. If services are already fast and nearby, or clients need very different, fine-grained data, forcing everything through one big aggregator can do more harm than good.
solid answer
~40 sCosts: the gateway is a new deployable with its own on-call burden and becomes a coupling point where every backend's contract change has to be reconciled against the aggregator's composition logic; its own latency floor equals the slowest fanned-out call, or worse if not parallelized; and it can become a single point of failure or bottleneck if not scaled or isolated correctly. It's the wrong tool when caller and callee already sit on a low-latency network where round-trip cost isn't the bottleneck; when different clients need such different data shapes that one generic aggregator turns into an unmaintainable pile of per-client branches, better served by per-client BFFs or letting clients call services directly; or when the composition needs strong cross-service transactional consistency, which aggregation at the response layer doesn't provide.
go deeper
Should be able to say aggregation adds an extra piece of infrastructure that needs to be built and run.
Should mention that the gateway's response time is bounded below by its slowest downstream call and that it becomes a new component to operate.
Should articulate the god-gateway anti-pattern, ownership and coupling costs across teams, and identify low-latency-already scenarios where aggregation isn't worth it.
Should give an organizational recommendation, for example per-client-team BFFs versus one shared aggregator, grounded in team topology and client diversity, and recognize that aggregation doesn't solve cross-service transactional consistency.
## The concrete cost - **A new service.** The concrete cost of adding an aggregation gateway is that it's a new service someone has to build, deploy, scale, secure, and put on-call rotation behind, not a free architectural overlay. - **A coordination tax.** It also introduces a coordination tax: because the gateway's composition logic depends on the exact contract of every backend service it wraps, a schema or behavior change in any wrapped service can require a corresponding change in the aggregator, meaning backend teams can no longer change their service in isolation without checking the gateway. - **The ownership question.** In practice this ownership question, whose job is it to update the aggregator when a downstream contract changes, often ends up as everyone's problem and therefore no one's, which is a real organizational cost separate from any purely technical one. ## When it earns its keep, and when it does not - The pattern **earns its keep** specifically when the caller and the backend services are separated by a real latency gap that fan-out amortizes, most classically a mobile or geographically distant client talking to services that live close together in one datacenter. - When the caller and callee already **share a low-latency network**, for example two internal services calling each other within the same availability zone at single-digit-millisecond round trips, there's essentially no round-trip cost left to amortize. Wrapping that call in an aggregator adds a hop and an operational burden for a latency benefit that barely exists, which makes the pattern a poor fit there even though it would be an excellent fit for a mobile client hitting the same backend. ## The 'god gateway' misuse A second common misuse is the 'god gateway' anti-pattern: as more client types and more screens get added, the path of least resistance is often to keep extending one generic aggregation endpoint with more optional fields and more conditional branches selecting what to include for which caller. Over time this accretes into a sprawling, hard-to-reason-about composition layer that every team touching any client has to modify, and where one team's change risks regressing another team's response shape. The alternative, splitting into several purpose-built, per-client-team-owned Backend-For-Frontend services, keeps each aggregator simpler by giving it one clear owner and one clear set of client needs to serve, at the cost of some duplicated composition logic across them. ## Failure modes 1. **The aggregator as a bottleneck.** In production, the aggregator itself can become a bottleneck or single point of failure even when every individual backend service is healthy, if its own compute or connection resources aren't isolated per downstream or per client type: a burst of aggregate requests can saturate the gateway's own thread or connection pool well before any wrapped service runs out of capacity, making the gateway the binding constraint rather than the services it's fronting. 2. **Assuming aggregation solves data consistency.** A related, subtler failure is assuming aggregation solves data consistency across services; it does not. Aggregation composes read-time responses from independently-updated services, so it cannot guarantee that the pricing and inventory data merged into one response were consistent with each other at the same instant, which matters for anything requiring strong cross-service transactional guarantees. ## Where it shows up A real-world illustration of when to deliberately avoid aggregation is a team building a public API for third-party partners: partner use cases vary too widely to predict one useful aggregate shape ahead of time, so exposing granular, individually-composable resource endpoints and letting partners combine them as needed is usually the better fit, even though it reintroduces some chattiness the partner has to manage themselves. By contrast, a single first-party mobile app team that controls both the client and can dictate exactly what the backend needs to compose is the classic good fit, which is why the Backend-For-Frontend pattern, popularized by teams like SoundCloud and Netflix for exactly this reason, pairs one aggregator with one client team rather than one aggregator with every possible caller.
- Why does an aggregation gateway sometimes become a bottleneck under load even if each individual downstream call is healthy?If the gateway's own compute or connection resources are shared across all client requests and not isolated per downstream or per client type, a burst of aggregate requests can saturate the gateway's thread or connection pool even when every backend service individually has capacity to spare, making the aggregator itself the constraint rather than any one service.
- Why can a single generic aggregation endpoint used by many different client types become hard to maintain?Different clients, web, mobile, partner API, often need meaningfully different subsets and shapes of data, so a single generic endpoint accretes conditional branches and optional query parameters over time. Splitting into a few purpose-built BFFs, each owned by the team that owns that client, usually keeps each individual aggregator simpler than one endpoint trying to serve everyone.
- In what scenario does gateway aggregation provide little to no latency benefit?When the caller and the backend services already sit on the same low-latency network, for example two internal services within the same datacenter calling each other directly, the round-trip cost the pattern is designed to amortize barely exists. Adding an aggregation hop there mostly adds operational overhead without meaningfully improving response time.
Like hiring a personal shopper for every errand even when the store is next door -- useful when the store is across town and traffic is bad, wasteful overhead when you could just walk in yourself.
saying these in an interview costs you the question
- treats aggregation as free, no mention of the extra service to own, deploy, or monitor
- recommends aggregating everything regardless of how close the caller and backend services already are
- doesn't recognize the 'god gateway' risk of one aggregator serving very different clients
- assumes aggregation solves data consistency across services