MinhVo

Minh Vo

rss feed

Slaying code & making it lit fr fr 🔥 tagline

Hey there 👋 I'm an AI Engineer with 7 years of experience building scalable web and mobile applications. Currently at Neurond AI (May 2025 — present), architecting an Enterprise AI Assistant Platform with multi-tenant RAG on pgvector, multi-provider LLM orchestration, and Azure-native infrastructure. Previously spent 5+ years at SNAPTEC (Sep 2019 — Apr 2025), leading SaaS themes, admin dashboards, and e-commerce platforms — earned the Hero of the Year award in 2021. I specialize in TypeScript, React, Next.js, and AI-Native engineering with Claude Code and Cursor.bio

Back to blogs

GraphQL Federation Building Distributed APIs at Scale

GraphQL Federation for distributed microservices. Apollo Federation, schema composition, entity resolution, performance optimization.

GraphQLfederationmicroservicesAPIApollowebapi

By MinhVo

Introduction

Monolithic GraphQL schemas break down in microservice architectures. GraphQL Federation allows each team to own a portion of the graph while presenting a unified schema to clients. Apollo Federation v2 is the dominant framework. Federation enables independent deployment, schema evolution, and resolver scaling. Companies like Netflix, Expedia, and Volvo use it in production.

Case for GraphQL Federation

webapi illustration

Monolithic GraphQL schemas break down in microservice architectures. GraphQL Federation allows each team to own a portion of the graph while presenting a unified schema to clients. Apollo Federation v2 is the dominant framework. Federation enables independent deployment, schema evolution, and resolver scaling. Companies like Netflix, Expedia, and Volvo use it in production.

Architecture Subgraphs and Gateway

Each subgraph is an independent GraphQL service. The supergraph schema is the composed result. The gateway receives queries, decomposes them into subgraph queries, executes them, and assembles results. Entity resolution enables cross-subgraph references. Entities are uniquely identified by keys and can be extended across subgraphs.

Schema Design and Performance

Entity design uses stable immutable keys. Field ownership: each field has a single owning subgraph. The at-provides and at-requires directives handle cross-subgraph dependencies. Performance: entity batching, caching with TTLs, query complexity analysis, and persisted queries. Distributed tracing with OpenTelemetry tracks execution across subgraphs.

Authentication and Migration

webapi illustration

Authentication at the gateway validates tokens and passes user context. Authorization at field, entity, and subgraph levels. Migration uses strangler fig pattern: deploy gateway pointing to monolith, extract domains incrementally. Each step is small and reversible. The monolith can be wrapped with Federation directives.

Tooling Ecosystem

Apollo Router (Rust) provides high performance. Apollo Studio offers schema registry, composition validation, and analytics. Alternatives: Cosmo Router (Go), Grafbase Gateway, graphql-mesh. Schema checks in CI catch composition errors before deployment. Contracts enable different schema views for different clients.

Scaling and Advanced Patterns

Gateway is stateless and scales horizontally. Subgraphs scale independently. Multi-region deployment with gateways close to users. Contracts filter schema by tags for mobile vs internal APIs. Multi-graph architectures share subgraphs across supergraphs. The ecosystem supports schema linting and automated deployment.

Conclusion

The topics covered in this article represent important developments in modern software engineering. By understanding these concepts deeply and applying them in your projects, you can build more robust, scalable, and maintainable systems. Continue exploring, experimenting, and building — the technology landscape rewards those who stay curious and keep learning.