Link
Embed
Share
Beginning
This slide
Copy link URL
Copy link URL
Copy iframe embed code
Copy iframe embed code
Copy javascript embed code
Copy javascript embed code
Share
Tweet
Share
Tweet
Slide 1
Slide 1 text
GraphQL ❤ PostgreSQL The Easy Way to Persisting Data in React @LukasFittl
Slide 2
Slide 2 text
Lets talk about State
Slide 3
Slide 3 text
https://xkcd.com/1653/
Slide 4
Slide 4 text
State
Slide 5
Slide 5 text
State State State State
Slide 6
Slide 6 text
State State State State State State State
Slide 7
Slide 7 text
State Store
Slide 8
Slide 8 text
State Store “The Server”
Slide 9
Slide 9 text
Serverless != Stateless
Slide 10
Slide 10 text
“The Server” “The Server” “The Server”
Slide 11
Slide 11 text
“The Server” “The Database” “The Server” “The Server”
Slide 12
Slide 12 text
“The Server” “The Database” “The Server” “The Server”
Slide 13
Slide 13 text
<===> State <===> <===>
Slide 14
Slide 14 text
Picking a Database
Slide 15
Slide 15 text
MySQL MongoDB PostgreSQL CockroachDB RethinkDB Cassandra Dynamo
Slide 16
Slide 16 text
MySQL MongoDB PostgreSQL CockroachDB RethinkDB Cassandra Dynamo
Slide 17
Slide 17 text
Why PostgreSQL?
Slide 18
Slide 18 text
1. Fast & Reliable 2. Deploy Anywhere 3. 100% Open Source, Community Included Why PostgreSQL?
Slide 19
Slide 19 text
1. Fast & Reliable 2. Deploy Anywhere 3. 100% Open Source, Community Included Why PostgreSQL?
Slide 20
Slide 20 text
1. Fast & Reliable 2. Deploy Anywhere 3. 100% Open Source, Community Included Why PostgreSQL?
Slide 21
Slide 21 text
Advanced Query Planner It also has: UPSERT Complex Types JSONB JOINs Window Functions CTEs High Availability LISTEN/NOTIFY
Slide 22
Slide 22 text
What We’re Going To Build
Slide 23
Slide 23 text
Dashboards & Stuff
Slide 24
Slide 24 text
Dashboards & Stuff
Slide 25
Slide 25 text
No content
Slide 26
Slide 26 text
github.com/ FormidableLabs/react-music
Slide 27
Slide 27 text
No content
Slide 28
Slide 28 text
Lets build a GraphQL Backend for react-music
Slide 29
Slide 29 text
GraphQL + PostgreSQL + react-music = BeatQL github.com/lfittl/beatql
Slide 30
Slide 30 text
Choosing a Backend Library
Slide 31
Slide 31 text
graphql-js + pg-promise
Slide 32
Slide 32 text
graphql-ruby + pg
Slide 33
Slide 33 text
postgraphql https://github.com/calebmer/postgraphql
Slide 34
Slide 34 text
[ $ new library ]
Slide 35
Slide 35 text
[ $ new library ]
Slide 36
Slide 36 text
graphql-js + pg-promise + dataloader
Slide 37
Slide 37 text
Figuring Out The Schema
Slide 38
Slide 38 text
Songs, Sequencers, Instruments
Slide 39
Slide 39 text
SQL!
Slide 40
Slide 40 text
No content
Slide 41
Slide 41 text
No content
Slide 42
Slide 42 text
No content
Slide 43
Slide 43 text
No content
Slide 44
Slide 44 text
GraphQL!
Slide 45
Slide 45 text
No content
Slide 46
Slide 46 text
No content
Slide 47
Slide 47 text
No content
Slide 48
Slide 48 text
Sample Data
Slide 49
Slide 49 text
No content
Slide 50
Slide 50 text
Based On relay-starter-kit
Slide 51
Slide 51 text
github.com/lfittl/beatql
Slide 52
Slide 52 text
data/
Slide 53
Slide 53 text
data/database.js
Slide 54
Slide 54 text
No content
Slide 55
Slide 55 text
No content
Slide 56
Slide 56 text
No content
Slide 57
Slide 57 text
No content
Slide 58
Slide 58 text
data/schema.js
Slide 59
Slide 59 text
No content
Slide 60
Slide 60 text
No content
Slide 61
Slide 61 text
No content
Slide 62
Slide 62 text
No content
Slide 63
Slide 63 text
Getting Only The Data You Need
Slide 64
Slide 64 text
No content
Slide 65
Slide 65 text
No content
Slide 66
Slide 66 text
No content
Slide 67
Slide 67 text
No content
Slide 68
Slide 68 text
data/database-helpers.js
Slide 69
Slide 69 text
Avoiding N+1 Queries
Slide 70
Slide 70 text
DataLoader!
Slide 71
Slide 71 text
No content
Slide 72
Slide 72 text
data/database-helpers.js
Slide 73
Slide 73 text
client/
Slide 74
Slide 74 text
client/components/ App.js
Slide 75
Slide 75 text
No content
Slide 76
Slide 76 text
No content
Slide 77
Slide 77 text
[ Demo ]
Slide 78
Slide 78 text
@LukasFittl github.com/lfittl/beatql FormidableLabs/react-music