March 19, 2024

Platform Engineering for APIs

Ishwari Lokare

Ishwari Lokare

The CNCF’s flagship KubeCon Europe 2024 conference is scheduled in Paris from 19-22 March 2024. Platform engineering continues to be a prominent theme this year, for which the CNCF recently issued a set of recommendations and a maturity model defining it. Apollo GraphQL helps API platform teams apply these recommendations to the API layer with Apollo GraphOS, its flagship product. Rather than delivering APIs as a barrage of new endpoints to manage, the Apollo GraphOS platform empowers teams to use GraphQL to build an API composition layer.

In this blog, you will learn why leading platform engineering teams are adopting federated GraphQL as a critical part of their API strategies. You’ll also get an overview how Apollo GraphOS improves developer experience by automating GraphQL API management.

Focus on API Developer Experience 

In today’s digital landscape, Application Programming Interfaces (APIs) have become the lifeline of modern businesses, driving personalized customer experiences, fostering collaboration, and facilitating monetization. Developers stand at the forefront of this API revolution, dedicating a significant portion of their efforts to managing APIs throughout their lifecycle.

Enabling faster and self-service access to these APIs isn’t just helpful to developers – it contributes significant business value for an organization. McKinsey’s recent research unveils a compelling correlation: companies prioritizing developer velocity outperform their market counterparts by a staggering four to five times. 

Platform engineering has emerged as a key enabler in this pursuit, reshaping how organizations approach software development and delivery. This involves creating an integrated internal developer platform (IDP) that provides self-service, automation, standardization, centralized security, and composability.  

Leading organizations like Netflix and Adobe are leveraging GraphQL and Apollo Federation to streamline API management and accelerate application delivery. 

Federated GraphQL: Crucial Layer of the Modern API Platforms

While GraphQL is often associated with frontend development due to its client-centric approach, its true value extends far beyond the frontend. With new GraphQL architectures like Apollo Federation, GraphQL can be leveraged as a complementary platform that sits on top of existing REST services, helping magnify an organization’s API investments. Federated GraphQL serves as a powerful composition layer within an API platform, providing several benefits that align with the principles of cloud-native architecture. Its ability to enable flexible architecture, seamless developer experience, cost optimization, improved performance, along with a thriving open-source community, makes GraphQL a crucial layer of the API platform.

The GraphQL Advantage 

Figure: GraphQL benefits across many dimensions

Architecture

This also helps to decouple frontend and backend development. Frontend teams can work independently, designing queries that suit their UI requirements without direct dependencies on backend changes. This autonomy facilitates concurrent development, where changes on one side don’t necessarily disrupt the other, fostering a more agile workflow.

GraphQL’s schema-driven design fosters a flexible architecture, facilitating seamless evolution of APIs and faster application development. GraphQL promotes a unified data model by serving as a single source of truth for the entire application. By defining a schema that outlines all available data types, their relationships, and the supported queries and mutations, GraphQL ensures a clear contract between the front-end and the back-end teams. This schema acts as a centralized reference point, ensuring that all data operations adhere to a predefined structure. 

GraphQL data is inherently declarative, enabling frontend teams to specify precisely the data they require. Furthermore, GraphQL’s hierarchical nature aligns with the relationships between different data entities, facilitating complex data retrieval across multiple data sources in a single request. By leveraging this hierarchical structure, GraphQL enables developers to efficiently retrieve interconnected data, eliminating the need to stitch together multiple responses as often required in RESTful architectures.

Developer Experience 

GraphQL offers many advantages, yet its single greatest benefit is the developer experience it provides. The strongly typed schema enables early error detection via validation and improves developer productivity through code generation and auto-completion. This results in more stable APIs with fewer bugs in development. Additionally, GraphQL’s introspection capability allows querying the API’s schema at runtime, providing insights into its structure, types, and fields. This capability aids faster application development via code-completion, API exploration, and documentation. 

Developers invest considerable time in developing and adapting APIs to meet dynamic customer and business requirements. Implementing modifications often requires intricate version control, a challenging task for developers. However, GraphQL addresses this challenge by providing built-in version control through schema, ensuring backward compatibility. This allows seamless incremental addition of new types to the schema without breaking changes to existing clients. 

Performance 

Performance efficiency stands as a defining strength of GraphQL within any API platform. By empowering API clients to request precisely the data they need, GraphQL significantly reduces over-fetching and under-fetching issues commonly encountered in traditional RESTful APIs.  This precision in data retrieval helps optimize network bandwidth and enhance overall performance by minimizing unnecessary data transfer. Additionally, GraphQL query responses can be cached granularly using Directives and cache-control headers. This caching capability optimizes resource usage by reducing server requests, enhancing performance, and delivering tailored, efficient data retrieval for varying client needs.

Cost  

Companies are constantly seeking to lower their costs in a bid to increase their profits. The bulk of these costs are usually tied directly to the production of software. GraphQL can aid in cost optimization by curbing unnecessary data transfer through its fine-grained data-fetching capabilities, it minimizes complexity and reduces network bandwidth consumption. Moreover, GraphQL’s ability to combine multiple requests into a single query can reduce server load, leading to more efficient resource utilization and potentially lower infrastructure costs. 

Use Cases  

GraphQL can be applied to a wide range of use cases, benefiting various industries and applications. GraphQL embraces the concept of subscriptions, enabling real-time data streaming use cases, such as anomaly detection, monitoring, and handling data from multiple IoT devices. For mobile apps, GraphQL minimizes data transfer and improves performance by allowing clients to request only the data they need. 

In recent years, there has been an explosion of microservices. In microservice architectures, GraphQL acts as a unified gateway to retrieve data from multiple services in a single request, eliminating the need for multiple API calls and reducing network latency. For ecommerce platforms, GraphQL facilitates personalized product recommendations, efficient data fetching for product listings, and real-time inventory management. This ensures a seamless shopping experience for customers while simplifying development efforts. For content management systems, GraphQL enables content authors to flexibly query and manipulate precisely the content they need for specific pages or components.

Ecosystem  

The success of any technology depends not just on its capabilities, but on the broader ecosystem of support and adoption nurtured by its community. A prime example is Kubernetes – beyond its inherent merits as a container orchestration system, its massive success is fueled by the surrounding ecosystem of tools, integrations, and support from the Cloud Native Computing Foundation. Similarly, GraphQL benefits immensely from its vibrant open-source community. 

With over 62,000 GitHub stars and usage by major enterprises like GitHub, Netflix, PayPal, Expedia, Shopify, Twitter and others, GraphQL has seen rapid adoption. In fact, a report from Gartner predicted that by 2025, more than 50% of enterprises will use GraphQL in production, up from less than 10% in 2021.

Companies like Apollo play a key role, actively building and contributing to the GraphQL ecosystem. This rich ecosystem ensures continuous innovation, diverse use cases, ample learning resources and integrations, cementing GraphQL as a powerful solution within the API landscape. 

Apollo GraphOS For Automating GraphQL API Management

As organizations discover the benefits of adopting a federated graph and its use spreads across different teams, the need for a scalable and evolvable graph solution becomes apparent. Developers want to tap into the power of graphs to build great products, without the burden of managing complex infrastructure themselves. They need a supergraph operating system that can scale globally to meet growing business needs, while letting them deploy rapid changes without breaking production. 

The solution is Apollo GraphOS, the platform for building, managing, and scaling a supergraph. Apollo GraphOS provides a centralized registry and standardized workflows so that any team can contribute to the graph. It also provides centralized data plane to extend Apollo Router,  enabling organizations to accommodate their API security, scalability, and extensibility needs. 

Safe and Rapid Graph Evolution 

Apollo GraphOS provides everything you need to build an API platform for the modern stack. It empowers teams to adopt a DevOps approach for deploying and managing GraphQL schemas and APIs through a series of robust features. It gives development teams the tools to develop schemas collaboratively with a single source of truth, deliver changes safely with graph CI/CD, and improve performance with field and operation-level observability. 

Figure: Applying DevOps phases to GraphQL API management
Figure: Applying DevOps phases to GraphQL API management

Download the “Platform Engineering for APIs” white paper now to discover the best practices for leveraging Apollo GraphOS at each DevOps stage to continuously deliver value on graphs with speed and safety, ultimately boosting the developer experience. 

Are you planning to attend  #KubeCon + #CloudNativeCon Europe in Paris from 19-22 March, 2024? Don’t forget to stop by Apollo booth G33 to discuss the key requirements for architecting an API platform that drives developer velocity, security and standardization. 

Written by

Ishwari Lokare

Ishwari Lokare

Read more by Ishwari Lokare