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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Lukas Fittl
August 26, 2016
Programming
640
1
Share
GraphQL ❤ PostgreSQL -- P.S. aka BeatQL
The Easy Way to Persisting Data in React
https://github.com/lfittl/beatql
Lukas Fittl
August 26, 2016
More Decks by Lukas Fittl
See All by Lukas Fittl
How to Scale Postgres - Automation, Tuning & Sharding
lfittl
0
690
What's Missing for Postgres Monitoring
lfittl
0
280
A Map For Monitoring PostgreSQL
lfittl
2
400
Monitoring Postgres at Scale
lfittl
1
480
Monitoring PostgreSQL at Scale
lfittl
4
280
Postgres Performance for App Developers
lfittl
2
330
Hacking PostgreSQL to Gain SQL Parsing Superpowers
lfittl
1
620
PostgreSQL at a Web Startup
lfittl
3
620
Advanced pg_stat_statements: Filtering, Regression Testing & more
lfittl
4
820
Other Decks in Programming
See All in Programming
Running Swift without an OS
kishikawakatsumi
0
880
Lightning-Fast Method Calls with Ruby 4.1 ZJIT / RubyKaigi 2026
k0kubun
3
2.4k
セグメントとターゲットを意識するプロポーザルの書き方 〜採択の鍵は、誰に刺すかを見極めるマーケティング戦略にある〜
m3m0r7
PRO
0
740
AI時代のエンジニアリングの原則 / Engineering Principles in the AI Era
haru860
0
1.1k
Agentic Elixir
whatyouhide
0
440
Kingdom of the Machine
yui_knk
2
1.4k
過去のレビュー知見をSkillsで資産化した話
pkshadeck
PRO
0
930
Back to the roots of date
jinroq
0
670
KMP × Kotlin 2.3 - How Android Got Slower While iOS Builds Improved by 47%
rio432
0
120
Firefoxにコントリビューションして得られた学び
ken7253
2
150
ハーネスエンジニアリングとは?
kinopeee
13
6.7k
Surviving Black Friday: 329 billion requests with Falcon!
ioquatix
0
2.7k
Featured
See All Featured
Writing Fast Ruby
sferik
630
63k
Visualization
eitanlees
150
17k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
130
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
190
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
180
Ethics towards AI in product and experience design
skipperchong
2
270
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
560
Leo the Paperboy
mayatellez
7
1.7k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
120
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.7k
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