This is a hands-on workshop that will teach you how to build a Web application that incorporate real-time communication between the client application running on the browser and the back-end server.
We will start with an overview of technologies and tools available for building real-time Web apps, what’s involved, the basics, and the gotchas. Next, we will build, in real-time, a real-time chat application using the python (Tornado) + socket.io + Backbone stack. Why not Node.js, you might ask. Simple: it’s too easy, too popular, and and not super-stable or secure. But you’re welcome to use Node.js as the backend in your own apps!
Scale your database traffic with Read & Write split using MySQL Router
Building Real-Time Web Applications
1. Building
Real-‐Time
Web
Applica4ons
Tony
Abou-‐Assaleh
&
Mark
Dineen
October
22,
2013
Volta
Labs
2. Agenda
•
•
•
•
•
•
•
What
is
real-‐time
web
The
stack
Client-‐side
Server-‐side
The
Flow
Beyond
the
basics
Live
Tutorial
Copyright
(c)
2013
TitanFile
Inc.
2
3. Who
we
are
• Tony
Abou-‐Assaleh
– PhD
in
Computer
Science
from
Dal
– Cofounder
and
CEO,
TitanFile
– Ex-‐Google,
VP
Tech
/
R&D
Director
@
GenieKnows
– Developed
the
initial
real-‐time
components
of
TitanFile
– Core
member
of
Backbone
Marionette
Team
Copyright
(c)
2013
TitanFile
Inc.
3
4. Who
we
are
• Mark
Dineen
– CTO,
TitanFile
– Made
RT
in
TitanFile
fast
and
secure
– Director
of
IT
at
Allianz
– Compliance
and
security
veteran
– Contributor
at
OWASP.org
Copyright
(c)
2013
TitanFile
Inc.
4
7. What
is
Real-‐Time
Web?
•
•
•
•
Saves
to
the
database
≠
real-‐time
Web
Periodic
refresh
≠
real-‐time
Web
Real-‐time
computing
≠
real-‐time
Web
Real-‐time
streaming
≠
real-‐time
Web
Copyright
(c)
2013
TitanFile
Inc.
7
8. What
is
Real-‐Time
Web?
A
set
of
technologies
and
practices
that
enable
users
to
receive
information
as
soon
as
it
is
published
by
its
authors,
rather
than
requiring
that
they
or
their
software
check
a
source
periodically
for
updates.
Copyright
(c)
2013
TitanFile
Inc.
8
9. What
is
Real-‐Time
Web?
•
•
•
•
Dynamic
user
interface
Server-‐side
push
Event-‐driven
Asynchronous
Copyright
(c)
2013
TitanFile
Inc.
9
10. Applica4on
of
RT
Web
•
•
•
•
•
•
•
Chat,
communication
Collaboration
Co-‐editing,
co-‐browsing,
co-‐shopping
Dashboards
and
monitoring
Gaming
Social
Web
Date
Streaming
Copyright
(c)
2013
TitanFile
Inc.
10
32. Pub
Sub
PaPern
•
•
•
•
Decouples
senders
from
receivers
Intermediate
hub
Senders
–
publish
messages
to
a
channel
Receivers
–
subscribe
to
a
channel
Copyright
(c)
2013
TitanFile
Inc.
32
33. The
Flow
@
TitanFile
Sender
Client
Server
Recipient
Client
User
Action
Django
Model
Saved
Django
post_save
Render
changes
Backbone
Model
Saved
Django
Handler
Django
signal
handler
Backbone
handler
ioSync
Socket.io
TornadIO2
Dispatcher
TorandIO2
Broadcast
ioBind
Socket.io
Copyright
(c)
2013
TitanFile
Inc.
33
34. Beyond
the
Basics
Real-‐World
Challenges
Copyright
(c)
2013
TitanFile
Inc.
34
35. Real
World
Challenges
•
•
•
•
Authentication
Security
Binary
Data
(Files)
Blocking
Code
– Database,
File
I/O,
Network
• Scalability
Copyright
(c)
2013
TitanFile
Inc.
35