![]() |
VOOZH | about |
We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.
Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.
Follow TNS on your favorite social media networks.
Become a TNS follower on LinkedIn.
Check out the latest featured and trending stories while you wait for your first TNS newsletter.
It’s hard to be in the business of building or consuming APIs in enterprise data/API landscapes. These complex landscapes typically have the following characteristics:
APIs are a collaborative affair. Though typically built by full-stack developers or by backend engineers, in multi-stakeholder enterprise-data landscapes with several parallel initiatives, there’s always tension in the system due to constrained bandwidth and conflicting goals. For instance:
| Design and Ownership | Benefits | Challenges |
| Domain-driven | Build once and reuse for all consumers. Consistent, standardized API for multiple consumers. |
Not optimized for consumer needs (GraphQL, performance-optimized requests, API integration, aggregation, orchestration, etc.) |
| Consumer-driven | Optimized for each consumer. | Difficult to standardize and needs to be purpose-built for every consumer/use case. Underlying sources could be heterogeneous. |
Crafting new application experiences in such a complex environment is complicated. The benchmark for new architecture models is their efficacy in handling such an environment and the agility they are able to generate for engineering teams working in complex data domains.
Supergraph is an architecture framework that’s evolved from years of supporting GraphQL federation architectures in enterprise organizations. It aims to address the commonly seen problems in this landscape by positing certain approaches to building domain API (subgraphs) and data-access API platforms (supergraphs). In this series, we will look at the core tenets of this architecture and how it benefits the API integration, aggregation and orchestration use cases. This first article will focus on API integration and aggregation.
The Supergraph architecture framework goes beyond proposing an architecture model by articulating an operating model for teams to collaborate. Here are some of the key tenets of the framework:
The Supergraph architecture enables an operating model for federated ownership of domains in an API platform. It uses a domain-first approach (that is source-aware) to generate a compiler-style API on any data domain (databases, REST, gRPC, etc.) to handle any CRUD requirements. This generated API is high-quality and protocol-agnostic — it can be configured to be one or more of REST, GraphQL or gRPC, etc. Here’s a quick example of a GraphQL schema generated on a table in a database:
Note: Notice how this type supports filtering, sorting and pagination.
The supergraph also allows for business logic, like commands from the CQRS (command query responsibility segregation) pattern, to be used in conjunction with domain models and repurposed to any output protocol. For instance, you can write TypeScript functions to implement some business logic and the unified API layer will expose this function as GraphQL or REST. With this, the supergraph is capable of delivering data/actions from/on domain models as well as associated business logic in the consumer protocol of choice with the least effort (that is spent on differentiated business logic and not on undifferentiated CRUD boilerplate).
Let’s focus on supergraph capabilities that allow “composition” over subgraphs as well as the quality of the subgraphs. Before we do this, let’s paint a better picture of this API landscape through an example so that we can subsequently use it as a reference in different use cases.
This landscape represents the aforementioned context:
In the next few sections, we’ll see how this context makes it challenging for API producers and consumers, and how using the Supergraph architecture, a data delivery layer can help address these challenges.
API integration is the process of calling an API to fetch new information (read) or to trigger an action (create/update/delete). From our initial context, think of the diverse needs of each API consumer and how hard it is to integrate with different domains given the heterogeneity of the data/API landscape.
👁 Graphic showing API integration.
From the API integration spaghetti above, it’s easy to visualize the following common challenges with API integration:
Any API layer that implements the Supergraph architecture is source-aware and output protocol-agnostic. This API layer also provides a common semantic layer and registry for the underlying domains and their APIs and makes these domains work interoperable. In addition to generating type-driven API protocols like GraphQL, gRPC, etc. this semantic layer allows it to generate documentation. See this reference GraphQL schema that a supergraph API platform can generate regardless of the underlying source. Learn more about my preferred API integration solution.
| Problem | Solution |
| API output format is ideal | API layer/platform generates any output format based on declarative config. It can generate more than one output format, so every consumer app can get their protocol of choice. |
| API does not have a typed schema | API layer/platform generates a type-driven GraphQL API or even automatically generates Open API documentation for the REST APIs it generates. |
| API’s documentation is missing or out of date | Supergraph-based API layer/platform is self-documenting, in sync with domain softare development life cycles, so always up to date. |
| API does not have standardized conventions | API layer/platform generates an API based on metadata, so it’s always standardized on quality attributes like pagination, filtering, sorting and aggregations wherever supported by the underlying domain source. |
| API versioning slows things down | The use of GraphQL in the API platform alleviates the need for versioning and provides logical models for an API’s schema to never be out of date. |
API aggregation refers to the process of combining multiple API requests into a single unified response. This technique is useful for optimizing data retrieval from multiple sources (it helps integrate with APIs faster), reducing the number of API calls when iterating on the consumer application and improving the performance of client applications.
👁 Graphic showing API aggregation
API aggregation is typically not handled by API gateways — one request is sent to only one upstream API. To support API aggregation, you need to write “glue” code or aggregate endpoints that can split the request to upstream APIs and then aggregate their responses for the consumer. But then you run into the operational challenge of ownership: Who owns this glue service(s)? Especially when the aggregation needs to span multiple domains, you also need to iterate on this glue code for every aggregation permutation you want to support.
Note: One way to avoid these iterations is to write a generic smart aggregation service, but that’s a very hard problem to solve: This smart service will need to double up as a service catalog for all upstream services that any new domain API will need to register with. Now you have an even bigger ownership problem.
To summarize, the following challenges make it hard to implement API aggregation in a complex data landscape:
The Supergraph architecture solves these challenges by targeting a self-serve API aggregation end state. For instance, domain data is onboarded into the supergraph (which is our API aggregation layer, among other things) in a way that allows the supergraph to use domain/source information (modeled as a graph) to automatically split an incoming request into individual upstream requests without requiring the development and maintenance of new aggregate endpoints. With this automation, there’s no need for an operating model for API aggregation, removing the need for expensive collaboration. (All collaboration is expensive!) You can read more about API aggregation.
| Problem | Solution |
| New APIs need new aggregation iterations | A Supergraph-based API platform is designed to provide automatic aggregation, leveraging the metadata about domains and sources. |
| Multi-domain API aggregation needs an operating model for collaboration/ownership | Supergraph allows self-serve or automatic aggregation because of its source-aware nature. This alleviates the need for expensive collaboration between developers. |
We can now compile the following checklist for any API platform (referred to as a supergraph) design that seeks to address the challenges of API integration and API aggregation:
| Guideline | Description |
| 1. Integration | Making it easy for API consumers to integrate APIs into their services. |
| 1.1 Multiple API formats | Can the supergraph platform automatically provide output formats beyond GraphQL such as REST/OpenAPI? This is required to support the integration needs of multiple consumers. |
| 1.2 Documentation | Does the supergraph platform help domain/platform owners maintain API documentation? If the underlying domain (database, code or APIs) are already documented, are those automatically picked up by the supergraph platform? |
| 1.3 Standardization | Does the supergraph platform provide or enforce a standardized domain API design such as pagination, filtering, sorting, etc.? |
| 2. Aggregation | Making it easy for API consumers to aggregate/batch multiple API calls into one. |
| 2.1 Relationships | Does the supergraph provide a way of creating relationships between any two entities or endpoints without requiring changes from the domain owners? |
| 2.2 Composability | How many “join” features does the supergraph provide, given a relationship between two entities in the supergraph? |
Measuring the effectiveness of a platform’s design to meet these criteria and the time/effort investment required to build these capabilities will provide any architect with a clear indication of the likely success of their platform initiative.