Why should I care?
Real-time functionality in webapps expected default
We are going to need to integrate real-time API's
We love to avoid re-inventing the wheel
Distributed Data Protocol
(as per spec)
"a protocol between client and server that supports RPC, the client subscribing to documents and the server sending changes about those documents"
Distributed Data Protocol
(as per matt and peter)
"a unique chance to define interoperability in realtime websockets, as http did for request response"
Distributed Data Protocol
- Coined March 21, 2012 by Matt DeBergalis
Pub Sub and Remote Procedure Call models
No HTTP / REST / Request-Response
JSON over bi-directional websockets
DDP spec
Connection
Managing Data
Remote Procedure Calls
Errors
DDP spec
Connection
CLIENT SERVER
=> connect
<= connected
<= failed
=> ping
<= pong
DDP spec
Managing Data
CLIENT SERVER
=> sub
<= added
<= added
<= ready
<= changed
<= removed
=> unsub
<= nosub
DDP spec
Remote Procedure Calls
CLIENT SERVER
=> method
<= result
<= changed
<= updated
DDP spec
errors
{
"msg": "result",
"id": "1",
"error": {
"error": 404,
"reason": "Method not found",
"message": "Method not found [404]",
"errorType": "Method.Error"
}
}
But I can't use meteor
You don't have to
Using DDP
- Full stack real-time web applications
Realtime functionality in any app
Internet of Things
But, will it scale?
limited to max connections per box
loadbalancing requires session affinity
autoscaling with hosted solutions like modulus
What I ask of you?
Push the web forward!
Use DDP instead of yet-another-ad-hoc-message-protocol
Voice DDP as standard and push tooling forward