Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Solve N+1 Problem in GraphQl API
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Ngalam Backend Community
April 28, 2019
Programming
53
2
Share
Solve N+1 Problem in GraphQl API
Ngalam Backend Community
April 28, 2019
More Decks by Ngalam Backend Community
See All by Ngalam Backend Community
Web_Scraping_with_Scrapy.pdf
ngalambackend
0
85
Introduction to Flask
ngalambackend
0
190
Achieving API Performance and Scalability
ngalambackend
0
92
Interfaces in Go
ngalambackend
0
63
CSS in JS in action
ngalambackend
0
59
Productive Remote Working with Scrum
ngalambackend
0
100
Covid Tracker Kota Malang
ngalambackend
0
72
Supercharge Local Development with Docker
ngalambackend
1
130
Building Scalable and Flexible API by Leveraging GraphQL and BigTable
ngalambackend
1
330
Other Decks in Programming
See All in Programming
JOAI2026 1st solution - heron0519 -
heron0519
0
140
Going Multiplatform with Your Android App (Android Makers 2026)
zsmb
2
440
PDI: Como Alavancar Sua Carreira e Seu Negócio
marcelgsantos
0
130
iOS機能開発のAI環境と起きた変化
ryunakayama
0
190
煩雑なSkills管理をSoC(関心の分離)により解決する――関心を分離し、プロンプトを部品として育てるためのOSSを作った話 / Solving Complex Skills Management Through SoC (Separation of Concerns)
nrslib
4
980
Making the RBS Parser Faster
soutaro
0
460
Spec Driven Development | AI Summit Vilnius
danielsogl
PRO
1
110
10年分の技術的負債、完済へ ― Claude Code主導のAI駆動開発でスポーツブルを丸ごとリプレイスした話
takuya_houshima
0
2.6k
第3木曜LT会 #28
tinykitten
PRO
0
110
NakouPAY説明用
annouim0
0
250
Cache-moi si tu peux : patterns et pièges du cache en production - Devoxx France 2026 - Conférence
slecache
0
280
ルールルルルルRubyの中身の予備知識 ── RubyKaigiの前に予習しなイカ?
ydah
1
190
Featured
See All Featured
[SF Ruby Conf 2025] Rails X
palkan
2
970
Information Architects: The Missing Link in Design Systems
soysaucechin
0
890
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
200
Git: the NoSQL Database
bkeepers
PRO
432
67k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.2k
The SEO identity crisis: Don't let AI make you average
varn
0
450
Crafting Experiences
bethany
1
120
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.1k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
420
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.9k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
190
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.1k
Transcript
Solve N+1 Problem in GraphQL API Disyam Adityana Putra Team
Leader @ Hash Rekayasa Teknologi
Ask The Audience • Raise Your Hand • Know GraphQL
• Try GraphQL • Use GraphQL
N+1 Problem
dataloader to the rescue
dataloader • batching • caching • per request • fetch
data modification
dataloader const DataLoader = require('dataloader') const userLoader = new DataLoader(keys
=> myBatchGetUsers(keys));
dataloader input = [2, 1, 5, 3, 4]; output =
[ { id: 2, name: "two" }, { id: 1, name: "one" }, { id: 5, name: "five" } { id: 3, name: "three" } { id: 4, name: "four" } ];
batching • The Array of values must be the same
length as the Array of keys • Each index in the Array of values must correspond to the same index in the Array of keys
caching const userLoader = new DataLoader(...) const result1 = await
userLoader.load(1) const result2 = await userLoader.load(1) assert(result1 === result2)
Other implementations PHP: DataLoaderPHP Ruby: Dataloader, BatchLoader ReasonML: bs-dataloader Java:
java-dataloader Elixir: dataloader Golang: Dataloader
Question?
Thank You code: https://github.com/disyam/graphql-loader