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
GraphQL ❤ PostgreSQL -- P.S. aka BeatQL
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Lukas Fittl
August 26, 2016
Programming
1
630
GraphQL ❤ PostgreSQL -- P.S. aka BeatQL
The Easy Way to Persisting Data in React
https://github.com/lfittl/beatql
Lukas Fittl
August 26, 2016
Tweet
Share
More Decks by Lukas Fittl
See All by Lukas Fittl
How to Scale Postgres - Automation, Tuning & Sharding
lfittl
0
680
What's Missing for Postgres Monitoring
lfittl
0
270
A Map For Monitoring PostgreSQL
lfittl
2
400
Monitoring Postgres at Scale
lfittl
1
470
Monitoring PostgreSQL at Scale
lfittl
4
280
Postgres Performance for App Developers
lfittl
2
320
Hacking PostgreSQL to Gain SQL Parsing Superpowers
lfittl
1
620
PostgreSQL at a Web Startup
lfittl
3
610
Advanced pg_stat_statements: Filtering, Regression Testing & more
lfittl
4
810
Other Decks in Programming
See All in Programming
Goの型安全性で実現する複数プロダクトの権限管理
ishikawa_pro
2
1.2k
コードレビューをしない選択 #でぃーぷらすトウキョウ
kajitack
3
1.1k
OTP を自動で入力する裏技
megabitsenmzq
0
120
ポーリング処理廃止によるイベント駆動アーキテクチャへの移行
seitarof
3
1.2k
コーディングルールの鮮度を保ちたい / keep-fresh-go-internal-conventions
handlename
0
230
Claude Code Skill入門
mayahoney
0
420
GoのDB アクセスにおける 「型安全」と「柔軟性」の両立 - Bob という選択肢
tak848
0
270
PHPのバージョンアップ時にも役立ったAST(2026年版)
matsuo_atsushi
0
240
The free-lunch guide to idea circularity
hollycummins
0
330
nuget-server - あなたが必要だったNuGetサーバー
kekyo
PRO
0
430
[PHPerKaigi 2026]PHPerKaigi2025の企画CodeGolfが最高すぎて社内で内製して半年運営して得た内製と運営の知見
ikezoemakoto
0
270
Cyrius ーLinux非依存にコンテナをネイティブ実行する専用OSー
n4mlz
0
240
Featured
See All Featured
The browser strikes back
jonoalderson
0
830
Discover your Explorer Soul
emna__ayadi
2
1.1k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.8k
KATA
mclloyd
PRO
35
15k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.8k
The Pragmatic Product Professional
lauravandoore
37
7.2k
Speed Design
sergeychernyshev
33
1.6k
Docker and Python
trallard
47
3.8k
Faster Mobile Websites
deanohume
310
31k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
330
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
490
Transcript
GraphQL ❤ PostgreSQL The Easy Way to Persisting Data in
React @LukasFittl
Lets talk about State
https://xkcd.com/1653/
State
State State State State
State State State State State State State
State Store
State Store “The Server”
Serverless != Stateless
“The Server” “The Server” “The Server”
“The Server” “The Database” “The Server” “The Server”
“The Server” “The Database” “The Server” “The Server”
<===> State <===> <===>
Picking a Database
MySQL MongoDB PostgreSQL CockroachDB RethinkDB Cassandra Dynamo
MySQL MongoDB PostgreSQL CockroachDB RethinkDB Cassandra Dynamo
Why PostgreSQL?
1. Fast & Reliable 2. Deploy Anywhere 3. 100% Open
Source, Community Included Why PostgreSQL?
1. Fast & Reliable 2. Deploy Anywhere 3. 100% Open
Source, Community Included Why PostgreSQL?
1. Fast & Reliable 2. Deploy Anywhere 3. 100% Open
Source, Community Included Why PostgreSQL?
Advanced Query Planner It also has: UPSERT Complex Types JSONB
JOINs Window Functions CTEs High Availability LISTEN/NOTIFY
What We’re Going To Build
Dashboards & Stuff
Dashboards & Stuff
None
github.com/ FormidableLabs/react-music
None
Lets build a GraphQL Backend for react-music
GraphQL + PostgreSQL + react-music = BeatQL github.com/lfittl/beatql
Choosing a Backend Library
graphql-js + pg-promise
graphql-ruby + pg
postgraphql https://github.com/calebmer/postgraphql
[ $ new library ]
[ $ new library ]
graphql-js + pg-promise + dataloader
Figuring Out The Schema
Songs, Sequencers, Instruments
SQL!
None
None
None
None
GraphQL!
None
None
None
Sample Data
None
Based On relay-starter-kit
github.com/lfittl/beatql
data/
data/database.js
None
None
None
None
data/schema.js
None
None
None
None
Getting Only The Data You Need
None
None
None
None
data/database-helpers.js
Avoiding N+1 Queries
DataLoader!
None
data/database-helpers.js
client/
client/components/ App.js
None
None
[ Demo ]
@LukasFittl github.com/lfittl/beatql FormidableLabs/react-music