Websockets & DDP:
in production

@peterpeerdeman

architect in online

CMD Minor

"Real-time Web"

a.k.a.

"Create a realtime application without a framework"

So here is my case. Using a framework

Whitelabel Intranet

Start Dashboard tech stack

  • Back-end: Meteor (NodeJS)
  • Front-end: React
  • Transport: DDP (websockets)

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 peter)

"a unique chance to define interoperability in realtime websockets, as http did for request response"

DDP spec

  • Connection
  • Managing Data
  • Remote Procedure Calls
  • Errors

Whitelabel Intranet

Websocket frame inspection demo

Code

"But I don't want to use meteor"

You don't have to

Code

endpointcon-server node example on github

endpointcon-client javascript example on github

That's great, but... will it scale?

  • limited to max connections per box
  • loadbalancing requires session affinity
  • autoscaling with hosted solutions like meteor galaxy
  • scale it yourself using docker images
  • checkout partup devops!

Bonus:

GraphQL

learngraphql.com

What I ask of you?

  • Push the web forward: pick a standard!
  • Give DDP in websockets a try
  • or use GraphQL subscriptions if you are feeling adventurous

Thank you
for your attention

github.com/peterpeerdeman/websockets-and-ddp-in-production

Websockets & DDP:
in production

@peterpeerdeman

BonusBonus:

GraphQL subscriptions

GitHunt-API & GitHunt-React