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
2
50
Solve N+1 Problem in GraphQl API
Ngalam Backend Community
April 28, 2019
Tweet
Share
More Decks by Ngalam Backend Community
See All by Ngalam Backend Community
Web_Scraping_with_Scrapy.pdf
ngalambackend
0
81
Introduction to Flask
ngalambackend
0
180
Achieving API Performance and Scalability
ngalambackend
0
87
Interfaces in Go
ngalambackend
0
59
CSS in JS in action
ngalambackend
0
56
Productive Remote Working with Scrum
ngalambackend
0
96
Covid Tracker Kota Malang
ngalambackend
0
68
Supercharge Local Development with Docker
ngalambackend
1
130
Building Scalable and Flexible API by Leveraging GraphQL and BigTable
ngalambackend
1
320
Other Decks in Programming
See All in Programming
今こそ知るべき耐量子計算機暗号(PQC)入門 / PQC: What You Need to Know Now
mackey0225
3
380
Oxlintはいいぞ
yug1224
5
1.3k
izumin5210のプロポーザルのネタ探し #tskaigi_msup
izumin5210
1
130
Oxlint JS plugins
kazupon
1
950
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
700
開発者から情シスまで - 多様なユーザー層に届けるAPI提供戦略 / Postman API Night Okinawa 2026 Winter
tasshi
0
200
Package Management Learnings from Homebrew
mikemcquaid
0
220
ぼくの開発環境2026
yuzneri
0
230
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
570
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
190
AIによる開発の民主化を支える コンテキスト管理のこれまでとこれから
mulyu
3
290
Architectural Extensions
denyspoltorak
0
290
Featured
See All Featured
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
66
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
440
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.2k
Color Theory Basics | Prateek | Gurzu
gurzu
0
200
A Modern Web Designer's Workflow
chriscoyier
698
190k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
110
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Odyssey Design
rkendrick25
PRO
1
500
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
110
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.4k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
140
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