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
650
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
410
Monitoring Postgres at Scale
lfittl
1
490
Monitoring PostgreSQL at Scale
lfittl
4
280
Postgres Performance for App Developers
lfittl
2
330
Hacking PostgreSQL to Gain SQL Parsing Superpowers
lfittl
1
630
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
開発とはなにか、Essenceカーネルで見えるもの
ukin0k0
0
220
CLIであることを活かしたGitHub Copilot CLI活用術 / GitHub Copilot CLI Pro Tips & Tricks
nao_mk2
1
1.1k
Stage 3 Decorators でできること / できないこと / TSKaigi 2026
susisu
1
1.2k
ビジネスモデルから紐解く、AI+型駆動開発
hirokiomote
2
3.3k
ユニットテストの先へ:テスト技法で要求・仕様を整理するJava開発実践 / Beyond_Unit_Testing_Practical_Java_Development_Techniques_for_Organizing_Requirements_and_Specifications
shimashima35
0
260
1人1案件のプロダクトエンジニア時代に、"プロセス監督"としてチャレンジしたこと
non0113
0
340
Copilot CLI の継戦能力を高める コンテキスト管理
nozomutu
1
1.1k
TypeSpec で繋ぐ複数プロダクトの型安全
maroon8021
1
260
SPMマルチモジュールで テストカバレッジを取得する技法
yosshi4486
0
120
Modding RubyKaigi for Myself
yui_knk
0
530
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
360
iOS26時代の新規アプリ開発
yuukiw00w
0
210
Featured
See All Featured
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
290
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
GraphQLとの向き合い方2022年版
quramy
50
15k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
150
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.5k
Deep Space Network (abreviated)
tonyrice
0
150
Rebuilding a faster, lazier Slack
samanthasiow
85
9.5k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.3k
New Earth Scene 8
popppiees
3
2.3k
We Have a Design System, Now What?
morganepeng
55
8.1k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.3k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
210
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