19. In Australia...
● Dangerous animals
● No central heating
● Engineers are lazy, don’t like to write a lot of code
@limenutt
20. In Australia...
● Dangerous animals
● No central heating
● Engineers are lazy, don’t like to write a lot of code
● Engineers are much more expensive than hardware
@limenutt
21. In Australia...
● Dangerous animals
● No central heating
● Engineers are lazy, don’t like to write a lot of code
● Engineers are much more expensive than hardware
● Engineers are scarse and precious
@limenutt
22. In Australia...
● Dangerous animals
● No central heating
● Engineers are lazy, don’t like to write a lot of code
● Engineers are much more expensive than hardware
● Engineers are scarse and precious
● IT businesses are mostly product companies,
(not agencies as opposed to CIS).
@limenutt
27. Soup du jour
● Why GraphQL
● Real-time API
● Real-time GraphQL API
@limenutt
28. Soup du jour
● Why GraphQL
● Real-time API
● Real-time GraphQL API
● Real-time GraphQL API on the Frontend
@limenutt
29. Soup du jour
● Why GraphQL
● Real-time API
● Real-time GraphQL API
● Real-time GraphQL API on the Frontend
● Cloud state management
@limenutt
30. Soup du jour
● Why GraphQL
● Real-time API
● Real-time GraphQL API
● Real-time GraphQL API on the Frontend
● Cloud state management
● Demo
@limenutt
31. Soup du jour
● Why GraphQL
● Real-time API
● Real-time GraphQL API
● Real-time GraphQL API on the Frontend
● Cloud state management
● Demo
● Tips & Tricks
@limenutt
34. ● Client decides what fields to fetch from the API
GraphQL features
@limenutt
35. ● Client decides what fields to fetch from the API
● No underfetching, or overfetching
GraphQL features
@limenutt
36. ● Client decides what fields to fetch from the API
● No underfetching, or overfetching
● Allows to combine multiple data sources
(database and 3rd party APIs) under a single
facade
GraphQL features
@limenutt
42. “Pull” API
Client Server
What’s the status of task #ZZ942α?
Here is the info for the task #ZZ942α!
What’s the status of task #ZZ942α?
@limenutt
43. “Pull” API
Client Server
What’s the status of task #ZZ942α?
Here is the info for the task #ZZ942α!
What’s the status of task #ZZ942α?
Here is the info for the task #ZZ942α!
@limenutt
44. “Pull” API
Client Server
What’s the status of task #ZZ942α?
Here is the info for the task #ZZ942α!
What’s the status of task #ZZ942α?
Here is the info for the task #ZZ942α!
@limenutt
46. Real-time API
Server
I’m interested in the task #ZZ942α?
Here is the current info for the task.
I’ll let you know if something changes.
Client
@limenutt
47. Real-time API
Server
I’m interested in the task #ZZ942α?
Here is the current info for the task.
I’ll let you know if something changes.
Looks like the progress has been updated.
Client
@limenutt
48. Real-time API
Server
I’m interested in the task #ZZ942α?
Here is the current info for the task.
I’ll let you know if something changes.
Looks like the progress has been updated.
The task is moved to Backlog.
Client
@limenutt
49. Real-time API
Server
I’m interested in the task #ZZ942α?
Here is the current info for the task.
I’ll let you know if something changes.
Looks like the progress has been updated.
The task is moved to Backlog.
You can no longer see the task, sorry.
Client
@limenutt
52. Real-time API
Server
I’m user #XX2104~, something I should know?
Here is your name in case you forgot.
I’ll let you know if anything happens.
Client
@limenutt
53. Real-time API
Server
I’m user #XX2104~, something I should know?
Here is your name in case you forgot.
I’ll let you know if anything happens.
There is a new task you might interested in
Client
@limenutt
54. Real-time API
Server
I’m user #XX2104~, something I should know?
Here is your name in case you forgot.
I’ll let you know if anything happens.
There is a new task you might interested in
Too late, someone else has grabbed already
Client
@limenutt
55. Real-time API
Server
I’m user #XX2104~, something I should know?
Here is your name in case you forgot.
I’ll let you know if anything happens.
There is a new task you might interested in
Too late, someone else has grabbed already
There is a new message for you, sir
Client
@limenutt
56. Real-time API
Server
I’m user #XX2104~, something I should know?
Here is your name in case you forgot.
I’ll let you know if anything happens.
There is a new task you might interested in
Too late, someone else has grabbed already
There is a new message for you, sir
Client
@limenutt
59. Real-time API Summary
● Client subscribes to the information of interest
● Server sends updates based on the clients’ subscriptions
@limenutt
60. Real-time API Summary
● Client subscribes to the information of interest
● Server sends updates based on the clients’ subscriptions
● If nothing changes, there are no updates.
@limenutt
61. Real-time API Summary
● Client subscribes to the information of interest
● Server sends updates based on the clients’ subscriptions
● If nothing changes, there are no updates.
● Client may have many different subscriptions at the same time
@limenutt
62. Real-time API Summary
● Client subscribes to the information of interest
● Server sends updates based on the clients’ subscriptions
● If nothing changes, there are no updates.
● Client may have many different subscriptions at the same time
● In 2020 we expect everything to be realtime and up-to-date.
@limenutt
63. Real-time API Technology
● Short polling (send requests every X seconds)
● Long polling
● WebSocket
● Server-Sent Events
● HTTP/2 Bidirectional streaming
@limenutt
72. ● Focus effort where your revenue is — PWA / mobile apps
Why go with Backend-as-a-service
@limenutt
73. ● Focus effort where your revenue is — PWA / mobile apps
● Cut the costs of having an additional layer to maintain
Why go with Backend-as-a-service
@limenutt
74. ● Focus effort where your revenue is — PWA / mobile apps
● Cut the costs of having an additional layer to maintain
● Highly scalable and secure backend
Why go with Backend-as-a-service
@limenutt
75. ● Focus effort where your revenue is — PWA / mobile apps
● Cut the costs of having an additional layer to maintain
● Highly scalable and secure backend
● Less code to change when the data structure changes
Why go with Backend-as-a-service
@limenutt
77. ● Firebase: no search, very limited filtering/sorting, slooow
Real-time BAAS quick comparison
@limenutt
78. ● Firebase: no search, very limited filtering/sorting, slooow
● Firestore: same, less slow
Real-time BAAS quick comparison
@limenutt
79. ● Firebase: no search, very limited filtering/sorting, slooow
● Firestore: same, less slow
● Realm: offline first, cloud service, $$$
Real-time BAAS quick comparison
@limenutt
80. ● Firebase: no search, very limited filtering/sorting, slooow
● Firestore: same, less slow
● Realm: offline first, cloud service, $$$
● Prisma: too DIY, a lot of boilerplate to write still
Real-time BAAS quick comparison
@limenutt
81. ● Firebase: no search, very limited filtering/sorting, slooow
● Firestore: same, less slow
● Realm: offline first, cloud service, $$$
● Prisma: too DIY, a lot of boilerplate to write still
● AWS AppSync: still a lot of backend work to do
Real-time BAAS quick comparison
@limenutt
82. ● Firebase: no search, very limited filtering/sorting, slooow
● Firestore: same, less slow
● Realm: offline first, cloud service, $$$
● Prisma: too DIY, a lot of boilerplate to write still
● AWS AppSync: still a lot of backend work to do
● Hasura: great, open-source, run on your servers
Real-time BAAS quick comparison
@limenutt
99. State management with Realtime API
Container 1
data
Component A
Component B
Page 2
Component A
Component B
Service
@limenutt
100. State management with Realtime API
Container 1
data
Component A
Component B
state
Page 2
Component A
Component B
Service
@limenutt
101. State management with Realtime API
Container 1
data
Component A
Component B
state
Page 2
Component A
Component B
Service Realtime API
@limenutt
102. State management with Realtime API
Container 1
data
Component A
Component B
state
Page 2
Component A
Component B
Service Realtime API
Mutate
@limenutt
103. State management with Realtime API
Container 1
data
Component A
Component B
state
Page 2
Component A
Component B
Service
Observe
Mutate
Realtime API
106. ● Receive minimal inputs from the parent or environment
Smart components
@limenutt
107. ● Receive minimal inputs from the parent or environment
● Define their own GraphQL subscriptions and mutations
Smart components
@limenutt
108. ● Receive minimal inputs from the parent or environment
● Define their own GraphQL subscriptions and mutations
● Rely on data models derived from GraphQL Schema (codegen)
Smart components
@limenutt
109. ● Receive minimal inputs from the parent or environment
● Define their own GraphQL subscriptions and mutations
● Rely on data models derived from GraphQL Schema (codegen)
● Use Rx to observe the state from the cloud
Smart components
@limenutt
110. ● Receive minimal inputs from the parent or environment
● Define their own GraphQL subscriptions and mutations
● Rely on data models derived from GraphQL Schema (codegen)
● Use Rx to observe the state from the cloud
● Mutate state directly in the cloud
Smart components
@limenutt
111. ● Receive minimal inputs from the parent or environment
● Define their own GraphQL subscriptions and mutations
● Rely on data models derived from GraphQL Schema (codegen)
● Use Rx to observe the state from the cloud
● Mutate state directly in the cloud
● DRY, single responsibility, responsive, etc.
Smart components
@limenutt
112. Smart components vs Dumb components
Container 1
state
Component A Component B
actions
Container 2
state
Component A
actions
@limenutt
113. Smart components vs Dumb components
Container 1
Component A
Container 2
Component B Component A
@limenutt
114. Smart components vs Dumb components
Container 1
Component A
Container 2
Component B Component A
Component AComponent A
@limenutt
131. State management with Realtime API
Container 1
data
Component A
Component B
state
Page 2
Component A
Component B
Service
Observe
Mutate
Realtime API
@limenutt
158. Don’t
List / table component Service
Observe a list of objects
and sub-objects of each
object in the list
in one subscription
Substandard UX
Item 1
Item 2
…...
Pagination, sorting, filtering
@limenutt
159. Do
List / table component Service
Observe a list of IDs
Item 1
Item 2
…...
Pagination, sorting, filtering
@limenutt
160. Do
List / table component Service
Observe a list of IDs
Item 1
Item 2
…...
Pagination, sorting, filtering
Observe item 1
Observe item 2
@limenutt