Pantheon’s Journey to a Unified API with Grafbase

| 5 min read

By Manuel Batule and Chris Reynolds

Pantheon’s journey to stable, evolving, and flexible services begins with a strong internal API that can scale to the demands of a world-class hosting company.  Pantheon partnered with Grafbase to design an API solution that brings us improved productivity, scalability, security, and velocity. This post dives into important technical details to explain what this change will mean to our customers.

What is Grafbase?

Grafbase is a platform that simplifies the process of building and deploying GraphQL APIs, especially for connecting to various data sources and managing them with a single endpoint. It acts as a unified data layer for platform operations and will scale along with us as we grow and add capabilities. It is highly performant, extensible, and reliable with fantastic support from the Grafbase team. With Grafbase, we get access to features like:

  • GraphQL Federation lets us split our API into independent subgraphs (individual, self-contained GraphQL services that define a distinct portion of a larger, federated GraphQL schema) and compose them into a single, unified schema. This allows for independent scaling of teams and services without a monolithic API.
  • Unified data layer connects and links different data sources into one unified GraphQL endpoint, aggregating data from various backend systems, databases, and APIs.
  • Customization and extensions will allow us to enhance our GraphQL APIs with WebAssembly modules that run natively within Grafbase. This allows for custom authentication, authorization, caching, and event streaming.

Pantheon is in the process of replacing Apollo Server, our current GraphQL solution for the Pantheon dashboard. As part of our new Pantheon Dashboard, we’re using Grafbase to power the dashboard through the use of new underlying services that support platform operations. Through this effort, we’ve improved our observability by tracing inbound requests end-to-end for deeper debugging capabilities. We have also laid the groundwork for much faster development and iteration through the use of Grafbase’s federated supergraph (a single, unified GraphQL schema composed of multiple independent subgraphs).

There are two main internal audiences who interact with Grafbase: consumers of the GraphQL API (Pantheon’s front-end engineers, internal clients, etc.) and the backend engineering teams who offer services through Grafbase via subgraphs. As Pantheon engineers create new services and integrate them into the supergraph, our engineering velocity will improve through the use of a well-defined internal API and a modern GraphQL gateway to serve requests. For example, we were able to use Grafbase extensions to handle authorization on each request.

How does it make things better?

Previously, platform operations were mostly tied to our legacy monolithic codebase, Yggdrasil. Over the past 15 years, Pantheon has outgrown the models and APIs afforded by Yggdrasil. With the introduction of Grafbase, we are unifying our internal API to provide a platform from which we can rebuild services, integrate new services quickly, and offer clean service boundaries and definitions going forward. For example, we implemented a new service that handles all GraphQL mutations submitted from the dashboard. With this new service, we now have a consistent internal API that can be leveraged for onboarding even more services to this new approach.

The introduction of a unified API layer in our platform accelerates our ability to bring new features to market in a scalable and consistent way. As a Pantheon user, you shouldn’t notice much – this work is happening behind the scenes and will improve velocity for our engineering teams. Down the road, our improved platform API will enable exciting new capabilities like a public API and AI integration!

For technical details on our journey, check out this article where our Architect, Alejandro Baez, shares details about our experience integrating Grafbase.

Author

Manuel Batule and Chris Reynolds

Discover More

Why we’re deploying a new PHP runtime

6 min read
Read More

Pantheon Joins Drupal AI Initiative

3 min read
Read More

From ChatGPT to AI Overviews: How Enterprises Win in Multiplatform AI Search

5 min read
Read More
Request a Pantheon platform demo