Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Solve N+1 Problem in GraphQl API
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Ngalam Backend Community
April 28, 2019
Programming
66
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
100
Introduction to Flask
ngalambackend
0
210
Achieving API Performance and Scalability
ngalambackend
0
100
Interfaces in Go
ngalambackend
0
110
CSS in JS in action
ngalambackend
0
72
Productive Remote Working with Scrum
ngalambackend
0
110
Covid Tracker Kota Malang
ngalambackend
0
76
Supercharge Local Development with Docker
ngalambackend
1
150
Building Scalable and Flexible API by Leveraging GraphQL and BigTable
ngalambackend
1
350
Other Decks in Programming
See All in Programming
sbt 2.0: takeoff
eed3si9n
0
160
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
270
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.9k
AIに “答え“を書かせるのを やめてみた
___akari11
0
120
Railsバージョンを4倍にした話
optim
0
350
contenteditable と日本語入力に向き合う
colorful12
0
200
最近”作らせてる” ローカルAIアプリの話
akit37
0
470
Railsのためのパスキー実践入門 〜マルチテナントSaaSでの意思決定〜
utakaha
2
540
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
220
気持ちぃ〜角丸 Squircle
ryu1013
0
310
見えないものを探る要求要件定義に必要な基本的思考 / invisible-requirement-thinking
minodriven
15
8.5k
Atomic Design, Enforced: Scaling Mobile Design Systems (next.app devCon / droidCon Berlin 2026)
steliosf
PRO
0
170
Featured
See All Featured
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.7k
The Pragmatic Product Professional
lauravandoore
37
7.5k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
12k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
22k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Google's AI Overviews - The New Search
badams
0
1.6k
The Limits of Empathy - UXLibs8
cassininazir
2
720
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.2k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
7k
For a Future-Friendly Web
brad_frost
184
10k
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