GraphQL Federation, the missing
piece of microservices
dtuan@alpha-sense.com / dt@luc.vc
https://www.alpha-sense.com/careers/helsinki/
Jobs are opening
1
AlphaSense is a
AI-Powered Search
leading all-in-one market intelligence platform
headquarters in US
recognized by Forbes
as a top 50 AI company in
2023
🇺🇸 🇫🇮 🇮🇳 🇸🇬 🇩🇪 🏴󠁧󠁢󠁥󠁮󠁧󠁿
API Team
GraphQL Service Development &
Maintenance
GraphQL Federation Knowledge
Leaders & Educators
Exposing GraphQL APIs to
External Clients
https://www.alpha-sense.com/
https://www.alpha-
sense.com/careers/helsinki/
4
Microservices are domain-based
monolith service services
5
Monolith
async function runQuery() {
try {
const client = await
pool.connect();
const result: QueryResult =
await client.query('SELECT *
FROM your_table_name');
client.release();
} catch (error) {
console.error('Error
executing query:', error);
}
}
Presentation Layer Logic Layer Data Layer
Database
6
Microservices
async function runQuery() {
try {
const client = await pool.connect();
const result: QueryResult = await
client.query('SELECT * FROM
your_table_name');
client.release();
} catch (error) {
console.error('Error executing query:',
error);
}
}
Database
APIs
User
async function runQuery() {
try {
const client = await pool.connect();
const result: QueryResult = await
client.query('SELECT * FROM
your_table_name');
client.release();
} catch (error) {
console.error('Error executing query:',
error);
}
}
Database
APIs
Search
async function runQuery() {
try {
const client = await pool.connect();
const result: QueryResult = await
client.query('SELECT * FROM
your_table_name');
client.release();
} catch (error) {
console.error('Error executing query:',
error);
}
}
Database
APIs
Watchlist
User team
Search team
Watchlist team
7
Consider following example
Client wants to fetch user together with documents
and their watchlists
USER Service DOCUMENT Service WATCHLIST Service
GET /user/123
GET /documents?user_id=123
GET /watchlists?user_id=123
with RESTful API
8
with GraphQL
USER Service
DOCUMENT Service
WATCHLIST Service
GraphQL Server
GraphQL Gateway
GraphQL Gateway
GraphQL Server
GraphQL simplifies data retrieval by allowing clients to fetch
information from multiple services using a single query.
With GraphQL, you can create a unified data responsecombining data from different
sources, making it much easier for clients to consume.
10
REST APIs typically have multiple endpoints for retrieving data from the server, while
GraphQLhas a multiple single endpointto which queries are sent.
Benefits
GraphQLhelps avoidthe issues of 'over-fetching' (retrieving too much data) and 'under-
fetching' (retrieving too little data) that often occur in REST APIs."
12
What is
GraphQL Federation?
13
Normal GraphQL Server?
USER Service
DOCUMENT Service
WATCHLIST Service
GraphQL Server
All the graphql
will be defined
in here
14
What is GraphQL Federation?
USER Service
DOCUMENT Service
WATCHLIST Service
GraphQL Gateway
Combine multipleGraphQL SubGraphs into
a single, federatedSuperGraph
This federated graphenables clients to interact
with multiple APIs through a single
request.
15
Unified GraphQL API
It allows the combination of multiple GraphQL APIs into a single, federated graph. This means clients can interact with multiple APIs through just
one request, streamlining the request and response cycle
Other benefits
Preserving Client Simplicity and Performance
It eliminates the need for multiple requests to different non-federated GraphQL APIs, offering the advantage of fetching all necessary data in a single request, which is
particularly beneficial in scenarios where multiple teams develop APIs independently
Simplified Schema Design at Scale
Unlike other approaches that may complicate the federated schema, GraphQL Federation allows clients to interact with the federated schema as if it were a single,
monolithic structure. This simplifies both frontend and backend interactions
Single API Maintenance
Each team contributes to the federated GraphQL schema, working independently without the need to maintain multiple API layers. This approach centralizes quality
control and updates to a single platform team
16
How to develop with GraphQL Federation?
GraphQL Gateway
USER Service
WATCHLIST Service
DOCUMENT Service
Git repositories CI/CD Pipeline
SuperGraph
Builder
17
SuperGraph builder
18
GraphQL Cosmo
Thanks!
Luc <dt@luc.vc>

More Related Content

PDF
GraphQL across the stack: How everything fits together
PPTX
Graph ql and enterprise
PDF
Scaling Your Team With GraphQL: Why Relationships Matter
DOCX
GraphQL Advanced Concepts A Comprehensive Guide.docx
PPTX
The API Journey: from REST to GraphQL
PDF
Adding GraphQL to your existing architecture
PDF
Mój przepis na skalowalną architekturę mikroserwisową? Apollo Federation i Gr...
PDF
apidays LIVE Paris - GraphQL meshes by Jens Neuse
GraphQL across the stack: How everything fits together
Graph ql and enterprise
Scaling Your Team With GraphQL: Why Relationships Matter
GraphQL Advanced Concepts A Comprehensive Guide.docx
The API Journey: from REST to GraphQL
Adding GraphQL to your existing architecture
Mój przepis na skalowalną architekturę mikroserwisową? Apollo Federation i Gr...
apidays LIVE Paris - GraphQL meshes by Jens Neuse

Similar to GraphQL Federation, the missing piece of microservices (20)

PDF
Graphql
PDF
How easy (or hard) it is to monitor your graph ql service performance
PDF
apidays LIVE Hong Kong 2021 - GraphQL : Beyond APIs, graph your enterprise by...
PPTX
Introduction to Graph QL
PDF
GraphQL: The Missing Link Between Frontend and Backend Devs
PDF
GraphQL Bangkok meetup 5.0
PDF
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
DOCX
How to Deploy a GraphQL API A Comprehensive Guide.docx
PDF
apidays Paris 2022 - Of graphQL, DX friction, and surgical monolithectomy, Fr...
PPTX
GraphQL.pptx
PPTX
GraphQL.pptx
PDF
OutSystsems User Group Netherlands September 2024.pdf
PDF
Introduction to GraphQL for beginners
PPTX
Introduction to GraphQL
PDF
All you need to know about GraphQL.pdf
PDF
GraphQL the holy contract between client and server
PPTX
Your API on Steroids
PDF
Your API on Steroids - Retrofitting GraphQL by Code, Cloud Native or Serverless
DOCX
Graphql for Frontend Developers Simplifying Data Fetching.docx
PDF
DEVOXX UK 2018 - GraphQL as an alternative approach to REST
Graphql
How easy (or hard) it is to monitor your graph ql service performance
apidays LIVE Hong Kong 2021 - GraphQL : Beyond APIs, graph your enterprise by...
Introduction to Graph QL
GraphQL: The Missing Link Between Frontend and Backend Devs
GraphQL Bangkok meetup 5.0
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
How to Deploy a GraphQL API A Comprehensive Guide.docx
apidays Paris 2022 - Of graphQL, DX friction, and surgical monolithectomy, Fr...
GraphQL.pptx
GraphQL.pptx
OutSystsems User Group Netherlands September 2024.pdf
Introduction to GraphQL for beginners
Introduction to GraphQL
All you need to know about GraphQL.pdf
GraphQL the holy contract between client and server
Your API on Steroids
Your API on Steroids - Retrofitting GraphQL by Code, Cloud Native or Serverless
Graphql for Frontend Developers Simplifying Data Fetching.docx
DEVOXX UK 2018 - GraphQL as an alternative approach to REST
Ad

More from Nguyễn Quang Huy (20)

PDF
Kiến thức cơ bản về tư duy số - VTC Net Viet
PDF
Human Security in the Tech Era Co-Create the Safe Future Mr. Linh Nguyen-Hoai...
PDF
Be good interviewer build great team - Nguyen Thanh Xuan
PDF
Explainable & Ethical Artificail Intelligence - Nhan Tran
PDF
Blockchain Technology Sharing Dang - Minh Tam
PDF
Prevent AI-based Phishing Attacks with #Passwordless Dr. Philip Hung Cao
PDF
Building Cloud-native Application Platform Thang Chung December 2023
PDF
CULTURE OF INNOVATION N.Thao 1.2 - Ms. Thao Tran.pdf
PDF
BUILDING THE FIRST VIETNAMESE SAAS UNICORN DREAM Nam Nguyễn CEO - OPLACRM
PDF
Vietnam_Affiliate_Report_2022_Shared_by_WorldLine_Technology.pdf
PDF
MỨC LƯƠNG & MONG ĐỢI NGHỀ NGHIỆP CỦA CÁC CHUYÊN GIA IT 2022 - 2023
PDF
Microsoft for Media and Entertainment.
PPTX
Customer Data & eXperience Platform (nền tảng dữ liệu khách hàng & trải nghiệ...
PDF
Gen Alpha & Gen Z Report
PDF
Cốc cốc - Kỷ nguyên mới của ngành Game tại Viet Nam
PDF
Mobile App in Vietnam 2022
PDF
VietnamITNation2020_ByTopDev.pdf
PDF
Adecco Vietnam Salary Guide 2021.pdf
PDF
TopCV Recruitment Insights 2021.pdf
PDF
APP STORE OPTIMIZATION (ASO) LÀ GÌ?
Kiến thức cơ bản về tư duy số - VTC Net Viet
Human Security in the Tech Era Co-Create the Safe Future Mr. Linh Nguyen-Hoai...
Be good interviewer build great team - Nguyen Thanh Xuan
Explainable & Ethical Artificail Intelligence - Nhan Tran
Blockchain Technology Sharing Dang - Minh Tam
Prevent AI-based Phishing Attacks with #Passwordless Dr. Philip Hung Cao
Building Cloud-native Application Platform Thang Chung December 2023
CULTURE OF INNOVATION N.Thao 1.2 - Ms. Thao Tran.pdf
BUILDING THE FIRST VIETNAMESE SAAS UNICORN DREAM Nam Nguyễn CEO - OPLACRM
Vietnam_Affiliate_Report_2022_Shared_by_WorldLine_Technology.pdf
MỨC LƯƠNG & MONG ĐỢI NGHỀ NGHIỆP CỦA CÁC CHUYÊN GIA IT 2022 - 2023
Microsoft for Media and Entertainment.
Customer Data & eXperience Platform (nền tảng dữ liệu khách hàng & trải nghiệ...
Gen Alpha & Gen Z Report
Cốc cốc - Kỷ nguyên mới của ngành Game tại Viet Nam
Mobile App in Vietnam 2022
VietnamITNation2020_ByTopDev.pdf
Adecco Vietnam Salary Guide 2021.pdf
TopCV Recruitment Insights 2021.pdf
APP STORE OPTIMIZATION (ASO) LÀ GÌ?
Ad

Recently uploaded (20)

PDF
Lean-Manufacturing-Tools-Techniques-and-How-To-Use-Them.pdf
PDF
Top 8 Trusted Sources to Buy Verified Cash App Accounts.pdf
PDF
SlidesGDGoCxRAIS about Google Dialogflow and NotebookLM.pdf
PPT
FIRE PREVENTION AND CONTROL PLAN- LUS.FM.MQ.OM.UTM.PLN.00014.ppt
PDF
Smart Home Technology for Health Monitoring (www.kiu.ac.ug)
PPTX
module 1-Part 1.pptxdddddddddddddddddddddddddddddddddddd
PDF
Understand the Gitlab_presentation_task.pdf
PPTX
1402_iCSC_-_RESTful_Web_APIs_--_Josef_Hammer.pptx
PPTX
Mathew Digital SEO Checklist Guidlines 2025
PPT
250152213-Excitation-SystemWERRT (1).ppt
PPTX
Database Information System - Management Information System
PDF
Exploring The Internet Of Things(IOT).ppt
PDF
Course Overview and Agenda cloud security
DOCX
Powerful Ways AIRCONNECT INFOSYSTEMS Pvt Ltd Enhances IT Infrastructure in In...
PDF
mera desh ae watn.(a source of motivation and patriotism to the youth of the ...
PPTX
newyork.pptxirantrafgshenepalchinachinane
PPTX
Layers_of_the_Earth_Grade7.pptx class by
PDF
The Evolution of Traditional to New Media .pdf
PDF
Uptota Investor Deck - Where Africa Meets Blockchain
PPT
415456121-Jiwratrwecdtwfdsfwgdwedvwe dbwsdjsadca-EVN.ppt
Lean-Manufacturing-Tools-Techniques-and-How-To-Use-Them.pdf
Top 8 Trusted Sources to Buy Verified Cash App Accounts.pdf
SlidesGDGoCxRAIS about Google Dialogflow and NotebookLM.pdf
FIRE PREVENTION AND CONTROL PLAN- LUS.FM.MQ.OM.UTM.PLN.00014.ppt
Smart Home Technology for Health Monitoring (www.kiu.ac.ug)
module 1-Part 1.pptxdddddddddddddddddddddddddddddddddddd
Understand the Gitlab_presentation_task.pdf
1402_iCSC_-_RESTful_Web_APIs_--_Josef_Hammer.pptx
Mathew Digital SEO Checklist Guidlines 2025
250152213-Excitation-SystemWERRT (1).ppt
Database Information System - Management Information System
Exploring The Internet Of Things(IOT).ppt
Course Overview and Agenda cloud security
Powerful Ways AIRCONNECT INFOSYSTEMS Pvt Ltd Enhances IT Infrastructure in In...
mera desh ae watn.(a source of motivation and patriotism to the youth of the ...
newyork.pptxirantrafgshenepalchinachinane
Layers_of_the_Earth_Grade7.pptx class by
The Evolution of Traditional to New Media .pdf
Uptota Investor Deck - Where Africa Meets Blockchain
415456121-Jiwratrwecdtwfdsfwgdwedvwe dbwsdjsadca-EVN.ppt

GraphQL Federation, the missing piece of microservices

  • 1. GraphQL Federation, the missing piece of microservices dtuan@alpha-sense.com / dt@luc.vc https://www.alpha-sense.com/careers/helsinki/ Jobs are opening
  • 2. 1 AlphaSense is a AI-Powered Search leading all-in-one market intelligence platform headquarters in US recognized by Forbes as a top 50 AI company in 2023 🇺🇸 🇫🇮 🇮🇳 🇸🇬 🇩🇪 🏴󠁧󠁢󠁥󠁮󠁧󠁿
  • 3. API Team GraphQL Service Development & Maintenance GraphQL Federation Knowledge Leaders & Educators Exposing GraphQL APIs to External Clients https://www.alpha-sense.com/ https://www.alpha- sense.com/careers/helsinki/
  • 5. 5 Monolith async function runQuery() { try { const client = await pool.connect(); const result: QueryResult = await client.query('SELECT * FROM your_table_name'); client.release(); } catch (error) { console.error('Error executing query:', error); } } Presentation Layer Logic Layer Data Layer Database
  • 6. 6 Microservices async function runQuery() { try { const client = await pool.connect(); const result: QueryResult = await client.query('SELECT * FROM your_table_name'); client.release(); } catch (error) { console.error('Error executing query:', error); } } Database APIs User async function runQuery() { try { const client = await pool.connect(); const result: QueryResult = await client.query('SELECT * FROM your_table_name'); client.release(); } catch (error) { console.error('Error executing query:', error); } } Database APIs Search async function runQuery() { try { const client = await pool.connect(); const result: QueryResult = await client.query('SELECT * FROM your_table_name'); client.release(); } catch (error) { console.error('Error executing query:', error); } } Database APIs Watchlist User team Search team Watchlist team
  • 7. 7 Consider following example Client wants to fetch user together with documents and their watchlists USER Service DOCUMENT Service WATCHLIST Service GET /user/123 GET /documents?user_id=123 GET /watchlists?user_id=123 with RESTful API
  • 8. 8 with GraphQL USER Service DOCUMENT Service WATCHLIST Service GraphQL Server GraphQL Gateway GraphQL Gateway GraphQL Server GraphQL simplifies data retrieval by allowing clients to fetch information from multiple services using a single query. With GraphQL, you can create a unified data responsecombining data from different sources, making it much easier for clients to consume.
  • 9. 10 REST APIs typically have multiple endpoints for retrieving data from the server, while GraphQLhas a multiple single endpointto which queries are sent. Benefits GraphQLhelps avoidthe issues of 'over-fetching' (retrieving too much data) and 'under- fetching' (retrieving too little data) that often occur in REST APIs."
  • 11. 13 Normal GraphQL Server? USER Service DOCUMENT Service WATCHLIST Service GraphQL Server All the graphql will be defined in here
  • 12. 14 What is GraphQL Federation? USER Service DOCUMENT Service WATCHLIST Service GraphQL Gateway Combine multipleGraphQL SubGraphs into a single, federatedSuperGraph This federated graphenables clients to interact with multiple APIs through a single request.
  • 13. 15 Unified GraphQL API It allows the combination of multiple GraphQL APIs into a single, federated graph. This means clients can interact with multiple APIs through just one request, streamlining the request and response cycle Other benefits Preserving Client Simplicity and Performance It eliminates the need for multiple requests to different non-federated GraphQL APIs, offering the advantage of fetching all necessary data in a single request, which is particularly beneficial in scenarios where multiple teams develop APIs independently Simplified Schema Design at Scale Unlike other approaches that may complicate the federated schema, GraphQL Federation allows clients to interact with the federated schema as if it were a single, monolithic structure. This simplifies both frontend and backend interactions Single API Maintenance Each team contributes to the federated GraphQL schema, working independently without the need to maintain multiple API layers. This approach centralizes quality control and updates to a single platform team
  • 14. 16 How to develop with GraphQL Federation? GraphQL Gateway USER Service WATCHLIST Service DOCUMENT Service Git repositories CI/CD Pipeline SuperGraph Builder