Latest / The API Podcast with Fexingo: REST, GraphQL, and Modern Web APIs / How API Composition Solves The Integration Tax
Transcript
- Lucas: You know that feeling when you look at your system diagram and it looks less like an architecture and more like a plate of spaghetti? That is exactly where most mid-size tech companies are right now. We call it the integration tax, and it is quietly bleeding margin out of engineering teams everywhere. Luna: It is funny because we talk so much about individual service performance, but nobody really measures the cost of making those services talk to each other until it breaks. Lucas: Right. And the problem is not that the services are bad. It is that we treat every new feature as another point to point connection. So if you have twenty-five backend services, you do not have twenty-five endpoints for your mobile app. You have roughly three hundred and seventy-five fragile wires holding everything together. One change in the inventory service can take down the checkout flow on a Tuesday morning. Luna: So instead of just wiring them directly, what if we treated the aggregation layer as a product itself? Lucas: Exactly. Let us look at a specific case from a global logistics provider I tracked last quarter. They had over forty distinct internal services handling tracking, billing, routing, and customer notifications. For their flagship app, they were calling eight different services just to render the main dashboard. That meant eight separate network hops, eight different authentication tokens, and eight potential points of failure before the user even saw a loading spinner. Luna: That sounds like a nightmare for latency, especially if half those services are in different data centers or regions. Lucas: It was terrible. Their average dashboard load time was hovering around two point four seconds, which feels slow to us, but for a consumer app, it is a conversion killer. The engineering team spent nearly forty percent of their sprint capacity just writing glue code to stitch those responses together. They were essentially acting as manual integrators rather than building new features. Luna: So they decided to stop writing glue code and started building a composition layer instead? Lucas: They did. And this is the core shift: they stopped treating API composition as an afterthought and built a dedicated orchestration service. Think of it like a restaurant kitchen. Instead of having waiters run back and forth between the bar, the grill, and the salad station every time a customer orders a meal, you have a single expeditor who coordinates all the stations and brings the finished plate out. That expeditor is your composition layer. Luna: I love that analogy because it highlights the difference between simply moving data and actually managing the workflow. Lucas: Precisely. By implementing this layer, they reduced the number of client-side calls from eight down to one. The composition service handles the parallel fetching internally. It knows that the billing info does not depend on the routing data, so it pulls both simultaneously. This dropped their dashboard load time to under six hundred milliseconds almost overnight. Luna: But didn't adding that middle layer introduce its own complexity? Usually, abstraction layers create new bugs. Lucas: That is a fair concern, but the math works out differently here. Before, every frontend developer needed to understand the quirks of eight different backend APIs. Now, they only need to understand one contract. The complexity moves from the client side to the backend, where you have senior engineers who can manage it properly. It centralizes the knowledge base. Luna: That makes sense. It shifts the burden from the many to the few, which is usually safer for quality control. Lucas: And it drastically reduces what we call technical debt accumulation. When you have point to point wiring, every new feature adds another wire. But with composition, you add a new field to the schema. It is additive rather than multiplicative. The structure stays stable even as the business logic grows. Luna: So this isn't just about speed. It's about preserving the sanity of the development team over the long haul. Lucas: Absolutely. And let us be clear about the economics. That logistics company reported a thirty percent reduction in cloud infrastructure costs within two quarters. Why? Because they eliminated redundant network traffic. Instead of sending the same customer profile data eight times across the internal network, the composition layer caches it once and serves it to all downstream consumers. Luna: That caching effect alone probably paid for the engineering hours to build the layer in less than a month. Lucas: It did. And there is a secondary benefit that nobody talks about much. Security. When you have hundreds of point to point connections, you have hundreds of places where an API key could be leaked or misconfigured. With a centralized composition layer, you enforce security policies in one place. If you need to rotate credentials or change authentication standards, you do it once, not eighty times. Luna: It basically turns your API strategy into a single source of truth rather than a distributed mess. Lucas: Yes. But here is where people get it wrong. They think they can just slap a library onto their existing codebase and call it composition. It does not work like that. You have to redesign how your services expose data. You cannot just dump raw database objects into the composition layer. You need to define clear contracts for what data is actually needed for each specific view. Luna: So it forces you to clean up your backend services first? You can't compose garbage effectively. Lucas: Spot on. You have to standardize your error handling, your response formats, and your timeout strategies. If one service throws a generic five hundred error and another returns a null pointer exception, your composition layer will choke. It requires discipline upfront, but the payoff is massive scalability later. Luna: Discipline is expensive early on, but chaos is expensive forever. I guess that is the trade-off. Lucas: Exactly. And look, if today's deep dive into api composition and integration tax gave you something usable for your own architecture review, the way these stay ad-free is listener support — buy me a coffee dot com slash fexingo. That is F. E. X. I. N. G. O. Luna: Yeah, if you find value in these structural breakdowns, helping keep the server lights on is always appreciated. Lucas: Back to the logistics example. Once they had that composition layer in place, they noticed something interesting about their mobile users. The app felt snappier, but also more reliable. Users stopped seeing partial data loads where the address showed up but the delivery window was blank. Luna: Because the composition layer could hold the whole request open until all necessary pieces were ready? Lucas: Correct. They implemented a fallback strategy. If the billing service was slow, the composition layer would still return the tracking data with a placeholder for the payment status. It never returned a broken page. It returned a complete, consistent state. That consistency is what builds trust with users. Luna: It’s amazing how often we ignore reliability in favor of raw speed, but a fast broken experience is worse than a slightly slower correct one. Lucas: Totally. And this approach also made their A/B testing much easier. Previously, changing the layout of the dashboard required changes in the frontend and coordination with three different backend teams. Now, they could tweak the composition query to pull different data sets or reorder fields without touching the underlying services. It decoupled the presentation layer from the data layer completely. Luna: That decoupling is the holy grail for any product team trying to iterate quickly without breaking things. Lucas: It is. But there is a risk of creating a monolith in disguise. If your composition layer becomes too complex, too many rules, too many conditional branches, you end up with a big ball of mud again. You have to resist the urge to put business logic inside the composition layer. Luna: So keep it dumb. Just gather data, shape it, and serve it. Don't make decisions. Lucas: Exactly. Keep the logic in the services. The composition layer is just a router with attitude. It decides the order, it handles the errors, it shapes the output. But it should not be calculating discounts or validating inventory counts. Those belong in the domain services. Luna: Keeping the responsibilities separate is hard when you're under pressure to ship, but it saves you from refactoring hell later. Lucas: It absolutely does. And for companies considering this shift, start small. Do not try to rewrite your entire backend ecosystem. Pick one high-traffic endpoint, maybe your user profile or your order history, and build a composition wrapper for just that. Measure the latency improvements, measure the reduction in support tickets, and then expand from there. Luna: Proof of concept first, then scale. It’s the only way to justify the initial engineering lift to stakeholders. Lucas: Right. And use the data. Show them that you saved ten thousand dollars in cloud costs and cut development time by twenty percent. That speaks the language of leadership better than any architectural diagram ever could. Luna: Numbers always win the argument. Especially when they come from a working prototype. Lucas: One final thought on this. As we move toward more event-driven architectures and real-time data streams, the composition layer becomes even more critical. It is the only thing standing between your users and the chaotic reality of distributed systems. Without it, you are just broadcasting noise. Luna: It’s the filter that turns noise into signal. I think that is the simplest way to put it. Lucas: I like that. Signal over noise. So, if you are staring at your own spaghetti diagram tonight, maybe ask yourself who the expeditor is in your kitchen. Or if you are just waiting for food to arrive in separate trips. Luna: Probably time to hire a new expeditor, or learn how to cook one yourself. Lucas: Something like that. Thanks for listening, and good luck with the integration.