Jump to Content
Developers & Practitioners

Apollo Scales GraphQL Platform using GKE

March 12, 2022
https://storage.googleapis.com/gweb-cloudblog-publish/images/ScaleGraphTumb.max-500x500.jpeg
Kaslin Fields

Developer Advocate

Every business has tools they start with, tools they grow with or grow out of, and tools they adopt along the way. GraphQL is an open source query language that many companies are adopting to modernize the way they, or their users, query resources. In this video, Apollo tells the story of how they’re meeting business’ needs by providing GraphQL solutions, while growing and innovating themselves.

Check out how Apollo is providing innovative GraphQL solutions backed by Google Cloud in the video above, and by reading on through this post.

What is GraphQL?

GraphQL is an open source API  query language which helps developers provide access to data via a graph interface. On the client side, users make requests via GraphQL to an API. On the server side, a GraphQL runtime executes queries using a type system defined for the data.

Benefits of GraphQL include having all your data accessible via one logical graph to help reduce redundancy and opening up data to people through convenient APIs.

What does Apollo do with GraphQL?

Apollo provides an implementation of GraphQL, including an open source client and server, along with tools and services to enable businesses to adopt and use GraphQL at scale.

Many businesses adopting GraphQL start by testing it out bit-by-bit. As their usage grows, Apollo provides tools to help manage GraphQL across applications at scale. For example, Apollo Federation allows separate teams to implement GraphQL as their specific needs call for, then joins them together to provide a single unified graph of all the data across teams.

Apollo’s Software as a Service (SaaS) application helps monitor GraphQL schemas as they change over time, understand who is accessing the data graph and how, and general provides tools needed for GraphQL at scale.

Built on Google Cloud

Apollo uses many components of Google Cloud to implement their architecture, including:

  • Pub/Sub

  • Google Kubernetes Engine

  • Cloud Functions

  • Cloud Spanner

  • BigQuery

  • CloudSQL

  • Cloud Storage

  • Bigtable

  • … and more!

A particularly interesting element of Apollo’s architecture is that the vast majority of their Google Cloud-based architecture is within a single cluster. Multiple teams, multiple products, all managed within one Google Kubernetes Engine (GKE) cluster.

In large part, this single-cluster architecture is an outcome of Apollo’s growth over time. Early on, one cluster was easily enough to handle all their needs, and GKE was flexible enough as a platform to enable Apollo’s teams to keep adding on to that strong foundation, all in the same cluster.  This single-cluster approach has its advantages and has been working well for Apollo. It simplifies logging and monitoring across various parts of the architecture, enables creation of custom tooling and automation in a consistent manner, and generally provides a unified platform for Apollo’s applications.

Special considerations to make this single-cluster method work include separating components using namespaces, such as creating separate production and staging environments within the cluster. GKE uses a concept of Node Pools to group worker nodes of the same instance types in a GKE cluster. These Node Pools, along with Kubernetes taints and tolerations, are a way Apollo customizes their GKE cluster to ensure workloads are scheduled onto appropriate hardware to suit the needs of the many workloads it runs.

Looking to the future

Apollo’s business is growing rapidly, prompting the team to think carefully about the tools they’re using and what they’ve learned about them over time.

For example, Engineering Manager Adam Zionts in our interview told tales of implementing and managing their own Kafka when that was the best solution for their needs, and that now the team is looking into new solutions that can reduce their workload while enabling them to focus on their core business.

Thus far, Apollo’s single-GKE-cluster approach to their architecture has proven advantageous thanks to the flexibility of GKE’s Node Pools and Kubernetes’ namespaces, taints, and tolerations.

As Apollo’s business grows, their engineering team is well-positioned to ensure their architecture continues to work for them.

Did you enjoy this architecture story? Find more on the Architecting with Google Cloud YouTube playlist!

Posted in