BETTER TOGETHER   Kav Latiolais (@kavla)       Partner - LIFFFT
A Brief Aside
System Design
Calling ServerClientsocket.emit function,  function: authUser  token: response.authResponse.accessTokenServersocket.on fun...
Changes to ClientServeruser.bind all, socketTunnelEvents(io.channel, [room, user])socketTunnelEvents = (tunnelSocket, obje...
Changes to ClientClient# Model event sent to us on a modelif not _.isArray(data.model) and not _.isArray(obj.toJSON())   r...
Changes to ClientClient# Model event sent on collectionif not _.isArray(data.model) and _.isArray(obj.toJSON())  switch da...
Questions?Kav Latiolais - @kavla
Better Together: Building Scalable Real Time Collaborative Apps with Node.js
Better Together: Building Scalable Real Time Collaborative Apps with Node.js
Better Together: Building Scalable Real Time Collaborative Apps with Node.js
Better Together: Building Scalable Real Time Collaborative Apps with Node.js
Better Together: Building Scalable Real Time Collaborative Apps with Node.js
Better Together: Building Scalable Real Time Collaborative Apps with Node.js
Better Together: Building Scalable Real Time Collaborative Apps with Node.js
Better Together: Building Scalable Real Time Collaborative Apps with Node.js
Better Together: Building Scalable Real Time Collaborative Apps with Node.js
Better Together: Building Scalable Real Time Collaborative Apps with Node.js
Better Together: Building Scalable Real Time Collaborative Apps with Node.js
Better Together: Building Scalable Real Time Collaborative Apps with Node.js
Better Together: Building Scalable Real Time Collaborative Apps with Node.js
Better Together: Building Scalable Real Time Collaborative Apps with Node.js
Better Together: Building Scalable Real Time Collaborative Apps with Node.js
Better Together: Building Scalable Real Time Collaborative Apps with Node.js
Better Together: Building Scalable Real Time Collaborative Apps with Node.js
Better Together: Building Scalable Real Time Collaborative Apps with Node.js
Better Together: Building Scalable Real Time Collaborative Apps with Node.js
Better Together: Building Scalable Real Time Collaborative Apps with Node.js
Better Together: Building Scalable Real Time Collaborative Apps with Node.js
Better Together: Building Scalable Real Time Collaborative Apps with Node.js
Upcoming SlideShare
Loading in …5
×

Better Together: Building Scalable Real Time Collaborative Apps with Node.js

1,339 views

Published on

If you're not using node to build collaborative real time applications you might as well be using rails. In this talk we'll discuss patterns and pitfalls of synchronous node apps. We'll roll up our sleeves and dig into some code demonstrating patterns that can help you get started building highly interactive applications that sync real time state with Node.js, Socket.io, and Backbone.js. You will leave this talk with insight on how to build synchronous experiences into your applications and avoid some of the pitfalls we've suffered.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,339
On SlideShare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
11
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • Building Social Apps is hard...\n
  • when you build real time collaborative apps you have that problem * every second of every day.\n
  • Solution: Don’t forget about single player mode.\n
  • What do I mean? Look at Turntable, no real single player experience at all.\n
  • But with Word^2 you can rack up points all day by yourself\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Better Together: Building Scalable Real Time Collaborative Apps with Node.js

    1. 1. BETTER TOGETHER Kav Latiolais (@kavla) Partner - LIFFFT
    2. 2. A Brief Aside
    3. 3. System Design
    4. 4. Calling ServerClientsocket.emit function, function: authUser token: response.authResponse.accessTokenServersocket.on function, (data, cb) -> unless data.function? then return cb false if functions[data.function] is undefined then return cb false functions[data.function](data, socket, cb)functions = authUser: (data, socket,cb) -> return cb false unless isValidFBToken(data.token) doSomeOtherBusinessLogicMagic(user) socket.user.set token:data.token return cb true
    5. 5. Changes to ClientServeruser.bind all, socketTunnelEvents(io.channel, [room, user])socketTunnelEvents = (tunnelSocket, object) -> (eventName, data) => if eventName.indexOf(:) is -1 tunnelSocket.emit backbone, action: eventName object: object model: data
    6. 6. Changes to ClientClient# Model event sent to us on a modelif not _.isArray(data.model) and not _.isArray(obj.toJSON()) return obj.set(data.model)# Collection event sent on collectionif _.isArray(data.model) and _.isArray(obj.toJSON()) return obj.reset(data.model)
    7. 7. Changes to ClientClient# Model event sent on collectionif not _.isArray(data.model) and _.isArray(obj.toJSON()) switch data.action when add return obj.add data.model when remove return obj.remove data.model when change model = obj.get data.model return model.set data.model # when destroy
    8. 8. Questions?Kav Latiolais - @kavla

    ×