Skip to content
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

Open
wants to merge 11 commits into
base: source
Choose a base branch
from
Open

Conversation

kamilkisiela
Copy link
Contributor

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.

Copy link

vercel bot commented Nov 15, 2024

@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.

Copy link

vercel bot commented Nov 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
graphql-github-io ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 4, 2024 6:12pm

@Urigo Urigo self-requested a review November 21, 2024 15:36
Copy link

@andrewicarlson andrewicarlson left a 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.

src/pages/learn/federation.mdx Outdated Show resolved Hide resolved
src/pages/learn/federation.mdx Outdated Show resolved Hide resolved
src/pages/learn/federation.mdx Outdated Show resolved Hide resolved
src/pages/learn/federation.mdx Outdated Show resolved Hide resolved
src/pages/learn/federation.mdx Outdated Show resolved Hide resolved
src/pages/learn/federation.mdx Outdated Show resolved Hide resolved
src/pages/learn/federation.mdx Outdated Show resolved Hide resolved
src/pages/learn/federation.mdx Outdated Show resolved Hide resolved
src/pages/learn/federation.mdx Outdated Show resolved Hide resolved
src/pages/learn/federation.mdx Outdated Show resolved Hide resolved
Comment on lines 9 to 13
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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mjmahone I'd love to get your input on this paragraph.

Copy link
Member

@benjie benjie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like an excellent resource; thanks for your work on it!

Please play close attention to capitalisation, for example:

  • "GraphQL Federation" - this is a Thing, a technology, because it is a proper noun
  • "GraphQL federation" - this is a concept, an approach, it is not a proper noun

Be sure you're using the right version in each case to help the reader interpret your intent.

The capitalisation of subheadings is also inconsistent, we generally use "Sentence case" in headings rather than "Title Case" (checked via grep -R '^##' src/pages/learn/) though there are definitely exceptions we should tidy up. Really we should have a style guide for this; if you fancy setting up Vale.sh as a separate PR feel free!

I think we might need to carefully audit usage of the word "graph", and perhaps replace it with "GraphQL schema" or other clearer wording in a few places - for example:

helping establish federation as a standard architectural pattern for building a distributed graph in the GraphQL ecosystem.

Conceptually you already have a distributed graph (your business entities), and federation is instead an architectural pattern for building a single GraphQL schema that models and enables interaction with your existing distributed graph. (I wouldn't necessarily use this wording in the docs though.)

I like that you've attempted to represent balance via the Meta/Netflix/Volvo/etc comparison; however it should be noted that these companies aren't just "at scale" but are at hyper scale - they are international household names. The vast vast majority of companies and organizations are not at this scale, so I'm concerned that text such as:

As you see, many industry leaders successfully federated their GraphQL APIs, proving that it works reliably for large-scale production applications.

will encourage smaller organizations to prematurely adopt federated GraphQL techniques thinking that we're recommending it. I think some additional qualifiers might help with this:

As you see, some of the world's largest industry leaders have successfully federated their GraphQL APIs, proving that it works reliably for production applications at an extraordinary scale.

May also be worth adding text that makes it clear you don't need to start with Federation out of the gate, but can upgrade to it later when you need it (rather than starting with it just in case you need it later).

Overall I think this is excellent content - thanks again for all your efforts!

@kamilkisiela kamilkisiela requested a review from benjie December 18, 2024 11:11
Copy link
Member

@benjie benjie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is excellent; the only part I'm hesitant on is the first three sentences - I'd love some feedback from @graphql/tsc on that paragraph in particular.

Thanks for your work on this @kamilkisiela 🙌

Copy link
Member

@benjie benjie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scratch that; though I'd still welcome the feedback of @mjmahone and @leebyron in particular, the text is accurate: monolithic approachs do often fall short, and they can become cumbersome - they don't always do these things, and there's plenty of examples of monoliths scaling massively just fine, but there's also plenty of counter-examples where microservices/etc are necessary.

@kamilkisiela
Copy link
Contributor Author

From my experience, there are more examples of broken monoliths than unnecessary usage of Apollo Federation, but I'm fine with adjusting the sentence a bit

@andimarek
Copy link
Contributor

This is excellent; the only part I'm hesitant on is the first three sentences - I'd love some feedback from @graphql/tsc on that paragraph in particular.

I would recommend to keep this section a bit more neutral. I get the sentiment, but there is no real reason to go into the trade off discussion here.

Something along the lines of "an alternative design approach to the classical monolith, often described as micro services (link to https://martinfowler.com/articles/microservices.html) has gained popularity in the last decade+".

We should not argue for one or the other and leave this discussion to much better pages like the Fowler page.

My 2cent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants