×
Copy
Open
Link
Embed
Share
Beginning
This slide
Copy link URL
Copy link URL
Copy iframe embed code
Copy iframe embed code
Copy javascript embed code
Copy javascript embed code
Share
Tweet
Share
Tweet
Slide 1
Slide 1 text
– move your app around – Real time web applications
Slide 2
Slide 2 text
– move your lazy blocking app around – Real time web applications for existing no NodeJS apps
Slide 3
Slide 3 text
Common issue…
Slide 4
Slide 4 text
Now your django/.net/rails project needs real time notifications
Slide 5
Slide 5 text
shit.
Slide 6
Slide 6 text
Idea #1
Slide 7
Slide 7 text
Idea #1 Create an API and do long polling.
Slide 8
Slide 8 text
What’s long polling?
Slide 9
Slide 9 text
–A dude who never fished. “Long polling is like fishing by continuously taking in and out the fishing rod.”
Slide 10
Slide 10 text
Example
Slide 11
Slide 11 text
No content
Slide 12
Slide 12 text
Advantage Works in every browser that supports XHR
Slide 13
Slide 13 text
Advantage No need of cross-server authentication
Slide 14
Slide 14 text
moving on…
Slide 15
Slide 15 text
Idea #2
Slide 16
Slide 16 text
Idea #2 Use web sockets.
Slide 17
Slide 17 text
How?
Slide 18
Slide 18 text
Does your server support WebSockets? I wish…
Slide 19
Slide 19 text
A WebSocket server is a TCP application
Slide 20
Slide 20 text
You can write one in any server-side programming language* * that is capable of Berkeley sockets
Slide 21
Slide 21 text
But…
Slide 22
Slide 22 text
Please, do not do that.
Slide 23
Slide 23 text
Use something already working instead
Slide 24
Slide 24 text
No content
Slide 25
Slide 25 text
No content
Slide 26
Slide 26 text
That’s NodeJS
Slide 27
Slide 27 text
Implementation
Slide 28
Slide 28 text
designing the two-server binding Architecture
Slide 29
Slide 29 text
Architecture Application DB Events DB
Slide 30
Slide 30 text
Current architecture Application DB Events DB
Slide 31
Slide 31 text
New NodeJS Server Events DB • Saves events in a database. • Serves an JSON API. • Servers an Socket.io application.
Slide 32
Slide 32 text
architecture design Models
Slide 33
Slide 33 text
No content
Slide 34
Slide 34 text
Application DB Events DB Connect through an API
Slide 35
Slide 35 text
architecture design API
Slide 36
Slide 36 text
No content
Slide 37
Slide 37 text
architecture design Events
Slide 38
Slide 38 text
No content
Slide 39
Slide 39 text
Advantage Secure API communication (only server-to-server)
Slide 40
Slide 40 text
Advantage Full-duplex communication
Slide 41
Slide 41 text
– websockets for the win – Real time web applications for existing no NodeJS apps
Slide 42
Slide 42 text
The End – Thanks –