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
Lukas Fittl
August 26, 2016
Programming
1
620
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
460
Monitoring PostgreSQL at Scale
lfittl
4
280
Postgres Performance for App Developers
lfittl
2
320
Hacking PostgreSQL to Gain SQL Parsing Superpowers
lfittl
1
610
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
株式会社 Sun terras カンパニーデック
sunterras
0
2k
20260228_JAWS_Beginner_Kansai
takuyay0ne
5
440
Takumiから考えるSecurity_Maturity_Model.pdf
gessy0129
1
120
どんと来い、データベース信頼性エンジニアリング / Introduction to DBRE
nnaka2992
1
130
Fundamentals of Software Engineering In the Age of AI
therealdanvega
0
140
15年目のiOSアプリを1から作り直す技術
teakun
1
600
New in Go 1.26 Implementing go fix in product development
sunecosuri
0
330
今、アーキテクトとして 品質保証にどう関わるか
nealle
0
200
AWS Infrastructure as Code の新機能 2025 総まとめ 〜SA 4人による怒涛のデモ祭り〜
konokenj
10
3.2k
CSC307 Lecture 13
javiergs
PRO
0
310
Go 1.26でのsliceのメモリアロケーション最適化 / Go 1.26 リリースパーティ #go126party
mazrean
1
350
Codex の「自走力」を高める
yorifuji
0
250
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Being A Developer After 40
akosma
91
590k
Documentation Writing (for coders)
carmenintech
77
5.3k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.4k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
140
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
67
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
130
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
110
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