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
Real-time API's with GraphQL
Search
Sandeep Singh
October 14, 2018
Research
1
340
Real-time API's with GraphQL
Sandeep Singh
October 14, 2018
Tweet
Share
More Decks by Sandeep Singh
See All by Sandeep Singh
NDC OSLO 2017
initialspark
1
180
DDD 12 - Goodbye REST; Hello GraphQL
initialspark
0
1.2k
DDDSouthwest - JavascriptServices: Building Single Page Applications with ASP.NET Core
initialspark
0
85
NDC London 2017 - Bundling Your front end with webpack
initialspark
0
150
Other Decks in Research
See All in Research
生成的推薦の人気バイアスの分析:暗記の観点から / JSAI2025
upura
0
280
Vision and LanguageからのEmbodied AIとAI for Science
yushiku
PRO
1
560
最適決定木を用いた処方的価格最適化
mickey_kubo
4
1.9k
スキマバイトサービスにおける現場起点でのデザインアプローチ
yoshioshingyouji
0
240
A scalable, annual aboveground biomass product for monitoring carbon impacts of ecosystem restoration projects
satai
4
350
情報技術の社会実装に向けた応用と課題:ニュースメディアの事例から / appmech-jsce 2025
upura
0
200
20250605_新交通システム推進議連_熊本都市圏「車1割削減、渋滞半減、公共交通2倍」から考える地方都市交通政策
trafficbrain
0
850
【輪講資料】Moshi: a speech-text foundation model for real-time dialogue
hpprc
3
750
AlphaEarth Foundations: An embedding field model for accurate and efficient global mapping from sparse label data
satai
3
330
不確実性下における目的と手段の統合的探索に向けた連続腕バンディットの応用 / iot70_gp_rff_mab
monochromegane
2
190
引力・斥力を制御可能なランダム部分集合の確率分布
wasyro
0
260
Pythonでジオを使い倒そう! 〜それとFOSS4G Hiroshima 2026のご紹介を少し〜
wata909
0
930
Featured
See All Featured
Why Our Code Smells
bkeepers
PRO
339
57k
Git: the NoSQL Database
bkeepers
PRO
431
66k
Done Done
chrislema
185
16k
Practical Orchestrator
shlominoach
190
11k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
23
1.5k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.6k
Statistics for Hackers
jakevdp
799
220k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
114
20k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
A Tale of Four Properties
chriscoyier
160
23k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
54
3k
Speed Design
sergeychernyshev
32
1.2k
Transcript
Real-Time API’s with GraphQL Sandeep Singh initialspark.co.uk @initial_spark
◦ What is GraphQL ? ◦ Why it exists and
the problems it aims to solve ? ◦ GraphQL core concepts ◦ Real-Time API’s – the what, why and how Agenda @initial_spark
GraphQL is a declarative query language for your API @initial_spark
@initial_spark
◦Built on specification ◦Hierarchical ◦Client‐driven ◦Strongly typed What is GraphQL?
@initial_spark
Q: Why GraphQL? @initial_spark
◦Efficiency ◦Predictability ◦Versioning ◦Caching ◦Security, tooling, documentation and more Modern
API considerations @initial_spark
Let’s look at an example… @initial_spark
@initial_spark
Efficiency @initial_spark
Efficiency @initial_spark GraphQL API Mongo DB AWS Lamba REST API
SOAP Service HTTP TCP/IP HTTP SOAP Optimisted data for each channel
Versioning Evolution @initial_spark
Tooling & DX @initial_spark
Introspection { __schema{ types{ name } } } • Query
schema, types and fields • Build tools o Auto complete / Validate (graphiql) o Code generation o Documentation @initial_spark
GraphQL Core Concepts @initial_spark
Schema Type System Query Language GraphQL Core Concepts @initial_spark
GraphQL Core Concepts - Resolvers @initial_spark
Schema Type System Query Language o Operations • Queries –
read • Mutations – write • Subscriptions – real-time o Alias o Fragments GraphQL Core Concepts @initial_spark
Lets build a GraphQL API! @initial_spark
@initial_spark
◦ Unpredictable Execution ◦ Handling File Upload ◦ Cache at
Network Level ◦ Authentication/Authorisation GraphQL - Challenges @initial_spark
Q:What about Real-time data? @initial_spark
@initial_spark Chat Notifications Live feed Collaborative
◦ Pull ◦ Polling - Short/Long - HTTP ◦ Push
◦ Subscriptions - Event driven ◦ Live queries - Infinitely fast/cheap polling (State driven) Real-Time API’s @initial_spark
◦ Real time events ◦ Idea: Server pushes data to
client when something ‘interesting’ occurs ◦ The client defines the shape of the data pushed to it Subscriptions – Event Based @initial_spark
◦ The initial state is large, but the incremental change
sets are small ◦ You care about low-latency updates in the case of specific events, e.g. chat application where users expect to receive new messages in a matter of seconds Subscriptions – When to use @initial_spark
Subscriptions Implementation @initial_spark
Subscriptions (Redis, Kafka, MQ, own?) @initial_spark Request / Response Bi-Directional
Transport (SSE, websockets etc) HTTP Subscription(s) GraphQL Domain Events Events
@initial_spark
Let’s look at another example… @initial_spark
@initial_spark GraphQL API Run Mutation Trigger Subscription subscription {patientDischarged{…}} PAS
View (Admin) Ward View (Nurse)
Lets have some fun with subscriptions @initial_spark
Advanced features – Enrich payload @initial_spark
@initial_spark There isn’t such thing as a free lunch…
◦ Scaling state is hard ◦ Who’s subscribed/ how do
we send messages etc ◦ QOS ◦ Throttling ◦ Buffering Subscriptions - Challenges @initial_spark
◦ http://graphql.org/learn/ ◦ https://www.youtube.com/watch?v=bn8qsi8jVew - Lee Byron ◦ https://github.com/apollographql/apollo-client ◦
https://github.com/initialspark/real-time-apis-graphql ◦ https://www.graphqlhub.com/ ◦ https://www.youtube.com/watch?v=4_Bcw7BULC8 - Authentication Resources @initial_spark
Thank you ! You can find me at @initial_spark &
initialspark.co.uk