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
Demystifying deepstream's HTTP API
Search
Srushtika Neelakantam
November 17, 2017
Technology
0
73
Demystifying deepstream's HTTP API
The fourth one from the webinar series by deepstream, exploring it's features and concepts.
Srushtika Neelakantam
November 17, 2017
Tweet
Share
More Decks by Srushtika Neelakantam
See All by Srushtika Neelakantam
Realtime data on the JAMstack
srushtika
0
73
NodeJS worker threads
srushtika
0
32
Building scalable breakout rooms with Node.js worker threads
srushtika
0
100
Building a multiplayer version of space invaders
srushtika
1
110
Ably Masterclass Episode 2 - Building an IoT based realtime attendance system for Slack
srushtika
0
2.5k
Ably Masterclass Episode 1 - Building a realtime voting app in less than an hour
srushtika
0
3.1k
Understanding how 'Hubs by Mozilla' works
srushtika
1
120
Mixed Reality - Zero to Hero in 25min
srushtika
1
110
The current state of the data sharing economy
srushtika
1
70
Other Decks in Technology
See All in Technology
こんなところでも(地味に)活躍するImage Modeさんを知ってるかい?- Image Mode for OpenShift -
tsukaman
0
110
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
10k
Azure Durable Functions で作った NL2SQL Agent の精度向上に取り組んだ話/jat08
thara0402
0
150
20260204_Midosuji_Tech
takuyay0ne
1
140
レガシー共有バッチ基盤への挑戦 - SREドリブンなリアーキテクチャリングの取り組み
tatsukoni
0
210
Introduction to Sansan, inc / Sansan Global Development Center, Inc.
sansan33
PRO
0
3k
Introduction to Bill One Development Engineer
sansan33
PRO
0
360
予期せぬコストの急増を障害のように扱う――「コスト版ポストモーテム」の導入とその後の改善
muziyoshiz
1
1.7k
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
3.8k
AIと新時代を切り拓く。これからのSREとメルカリIBISの挑戦
0gm
0
830
学生・新卒・ジュニアから目指すSRE
hiroyaonoe
2
570
モダンUIでフルサーバーレスなAIエージェントをAmplifyとCDKでサクッとデプロイしよう
minorun365
4
170
Featured
See All Featured
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
How STYLIGHT went responsive
nonsquared
100
6k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
170
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.4k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
64
Mind Mapping
helmedeiros
PRO
0
78
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
Transcript
demystifying deepstream’s HTTP API Srushtika Neelakantam @Srushtika |
[email protected]
[email protected]
HTTP? Realtime?
• IoT, FTW. • Bulk dump. • No deepstream? No
problem! • Fan of CGI languages? - We got you covered.
HTTP
AJAX POLLING AJAX LONG POLLING HTTP/2
HTTP isn’t realtime. Hence: Receive a Pub/Sub event Get record
updates for Data-Sync Presence Subscribe Anything else that requires persistent connections. x x x x
general format <HTTP ENDPOINT URL> POST DAT A
with deepstream.io
config.yml
with deepstreamHub
application dashboard
authentication request { "type": "webhook", "email": "
[email protected]
", "password": "y4b4d4b4d00" }
with deepstream.io localhost://8080/auth with deepstreamHub <HTTP AUTH URL> No Auth
File Auth Webhook Auth No Auth Token Auth Email Auth Webhook Auth
authentication request { "type": "webhook", "email": "
[email protected]
", "password": "y4b4d4b4d00" }
authentication response { "success": "true", "token": "aI2wYSh1FS_2WODD14bYZe1TfIyhAukl", "clientData": { "profileColor":
"brown", "Id": "s64907sdkjdsif" } }
ERROR plain text messages with 4xx status codes
POST requests: • Emit an event. • Read a record.
• Create and update a record. • Delete a record. • Make an RPC. • Query presence.
command format requests responses • topic • action • success
• error • errorTopic • errorEvent
emitting an event { "topic": "event", "action": "emit", "eventName": "lights-on",
"data": 134.52 }
reading a record { "topic": "record", "action": "read", "recordName": "my-record"
}
reading a record { "topic": "record", "action": "read", "recordName": "my-record"
} { "success": true, "version": 2, "data": { "foo": "bar" } } request response
record heads { "topic": "record", "action": "head", "recordName": "my-record" }
record heads { "topic": "record", "action": "head", "recordName": "my-record" }
{ "success": true, "version": 2 } request response
creating and updating a record { "topic": "record", "action": "write",
"recordName": "users/123", "path": "firstname", "version": 6, "data": "Bob" }
creating and updating a record { "success": false, "error": "Record
update failed. Version 6 exists for record \"users/123\".", "errorTopic": "record", "errorEvent": "VERSION_EXISTS", "currentVersion": 6, "currentData": { "firstname": "Alan", "lastname": "Smith" } } response
deleting a record { "topic": "record", "action": "delete", "recordName": "my-record"
}
making an RPC { "topic": "rpc", "action": "make", "rpcName": "add-two",
"data": { "numA": 2, "numB": 5 } }
making an RPC { "topic": "rpc", "action": "make", "rpcName": "add-two",
"data": { "numA": 2, "numB": 5 } } { "success": true, "data": 7 } request response
querying presence { "topic": "presence", "action": "query" }
querying presence { "success": true, "users": [ "ac65902c-13ea-469c-91e6-2cdc8c31136d", "fba85ac8-02bd-98a7-bb42-b2526243b562", "aba325bd-dd23-aba4-3390-02763477453e"
] } response
batching HTTP requests
That’s all folks ! questions? @Srushtika |
[email protected]
[email protected]