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
72
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
70
NodeJS worker threads
srushtika
0
28
Building scalable breakout rooms with Node.js worker threads
srushtika
0
89
Building a multiplayer version of space invaders
srushtika
1
98
Ably Masterclass Episode 2 - Building an IoT based realtime attendance system for Slack
srushtika
0
2.3k
Ably Masterclass Episode 1 - Building a realtime voting app in less than an hour
srushtika
0
2.7k
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
57
Other Decks in Technology
See All in Technology
事業価値と Engineering
recruitengineers
PRO
6
3.9k
退屈なことはDevinにやらせよう〜〜Devin APIを使ったVisual Regression Testの自動追加〜
kawamataryo
4
820
アジャイルテストで高品質のスプリントレビューを
takesection
0
120
どこで動かすか、誰が動かすか 〜 kintoneのインフラ基盤刷新と運用体制のシフト 〜
ueokande
0
200
Understanding Go GC #coefl_go_jp
bengo4com
0
1.1k
AIとTDDによるNext.js「隙間ツール」開発の実践
makotot
6
750
microCMS 最新リリース情報(microCMS Meetup 2025)
microcms
0
210
Evolution on AI Agent and Beyond - AGI への道のりと、シンギュラリティの3つのシナリオ
masayamoriofficial
0
230
LLMエージェント時代に適応した開発フロー
hiragram
1
430
広島銀行におけるAWS活用の取り組みについて
masakimori
0
150
実践AIガバナンス
asei
3
160
kintone開発チームの紹介
cybozuinsideout
PRO
0
73k
Featured
See All Featured
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.8k
Build The Right Thing And Hit Your Dates
maggiecrowley
37
2.8k
Git: the NoSQL Database
bkeepers
PRO
431
65k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3.1k
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
Large-scale JavaScript Application Architecture
addyosmani
512
110k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.4k
Done Done
chrislema
185
16k
Building an army of robots
kneath
306
46k
Documentation Writing (for coders)
carmenintech
73
5k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.4k
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]