-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Learn GraphQL federation #1826
base: source
Are you sure you want to change the base?
Learn GraphQL federation #1826
Conversation
@kamilkisiela is attempting to deploy a commit to the The GraphQL Foundation Team on Vercel. A member of the Team first needs to authorize it. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! I added some suggestions that I thought helped clarify some specific points or drive the metaphors around federation home.
In today's world of distributed systems and microservices, | ||
organizations face the challenge of efficiently managing and scaling their APIs. | ||
As applications grow more complex, traditional monolithic approaches often fall short. | ||
This is where federation comes into play - an architectural pattern that has found particular resonance in the GraphQL ecosystem. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if reorganizing this intro would make it land a little clearer for folks unfamiliar with Federation. For example: Problem -> parallel solution (metaphor) -> How it relates to Federation.
In today's world of distributed systems and microservices, | |
organizations face the challenge of efficiently managing and scaling their APIs. | |
As applications grow more complex, traditional monolithic approaches often fall short. | |
This is where federation comes into play - an architectural pattern that has found particular resonance in the GraphQL ecosystem. | |
As applications grow more complex, traditional monolithic approaches often fall short. At scale, monolithic architectures can become cumbersome, brittle, and increasingly hard to test and validate. This has led to a rise in the adoption of new patterns like distributed systems and microservices. In some ways, GraphQL Federation is like microservices for GraphQL – an architectural pattern that has found particular resonance in the GraphQL ecosystem. |
|
||
GraphQL Federation gained widespread adoption after [Apollo GraphQL introduced Apollo Federation in 2019](https://www.apollographql.com/blog/apollo-federation-f260cf525d21). | ||
Their implementation has become a reference point for the GraphQL community, | ||
helping establish federation as a standard architectural pattern in the GraphQL ecosystem. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
helping establish federation as a standard architectural pattern in the GraphQL ecosystem. | |
helping establish federation as a standard architectural pattern for building a distributed graph in the GraphQL ecosystem. |
Their implementation has become a reference point for the GraphQL community, | ||
helping establish federation as a standard architectural pattern in the GraphQL ecosystem. | ||
|
||
The GraphQL ecosystem is moving towards standardization of federation patterns. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The GraphQL ecosystem is moving towards standardization of federation patterns. | |
With more companies and developers seeing the benefits of building a distributed graph with federation, the GraphQL ecosystem is now moving towards standardization of federation patterns. |
|
||
## What is federation? | ||
|
||
Federation is an approach to organizing and managing distributed systems. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Federation is an approach to organizing and managing distributed systems. | |
Architecturally, federation is an approach to organizing and managing distributed systems. |
|
||
- Define their own GraphQL schema | ||
- Deploy and scale their service independently | ||
- Contribute to a unified API without tight coupling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Contribute to a unified API without tight coupling | |
- Contribute to a unified GraphQL API without tight coupling |
|
||
### Scalability and Performance | ||
|
||
Services can be scaled independently based on their specific requirements. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Services can be scaled independently based on their specific requirements. | |
Subgraphs and services can be scaled independently based on their specific requirements. |
|
||
### Single, Unified API | ||
|
||
Thanks to GraphQL gateway, clients get a single endpoint with unified schema. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks to GraphQL gateway, clients get a single endpoint with unified schema. | |
Thanks to GraphQL, clients get a single endpoint with unified schema spanning multiple subgraphs. |
|
||
## Federation vs. Monolithic Architecture | ||
|
||
While monolithic GraphQL APIs have their place, federation offers several advantages for larger applications: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While monolithic GraphQL APIs have their place, federation offers several advantages for larger applications: | |
While monolithic GraphQL APIs have their place, federated architectures offer several advantages for larger applications: |
1. **Identify Service Boundaries**: Define clear boundaries between different domains in your application | ||
2. **Design Schemas**: Create schemas that reflect these boundaries while considering how they'll interact | ||
3. **Implement Subgraphs**: Build individual services that implement their portion of the schema | ||
4. **Set Up Gateway**: Deploy a federation gateway to compose and serve the unified schema |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4. **Set Up Gateway**: Deploy a federation gateway to compose and serve the unified schema | |
4. **Set Up a federated Gateway**: Deploy a federation gateway to compose and serve the unified schema |
4. **Set Up Gateway**: Deploy a federation gateway to compose and serve the unified schema | ||
5. **Monitor and Optimize**: Implement monitoring and continuously optimize query performance | ||
|
||
Organizations can gradually migrate from a monolithic to federated GraphQL, one service at a time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Organizations can gradually migrate from a monolithic to federated GraphQL, one service at a time. | |
Organizations can gradually migrate from a monolithic to federated GraphQL implementation, one service at a time. |
I thought about creating a page that explains what federation in context of GraphQL even means,
to create a good entry point for people interested in this space and looking for information.
It could help to shine more light on Composite Schema Working Group and the spec that's in progress.
The WG would have a page to explain what, how and why.
It's an initial draft, something to iterate on, think what to include etc. Happy to hear your thoughts.