SlideShare a Scribd company logo
Building Next Generation
Real-Time Web Applications
- Naresh Chintalcheru
Real-Time
● What are Real-Time Web Apps ?
● HTTP Half-Duplex to Full-Duplex WebSocket (WS) Protocol
● HTTP 1.1 keep-alive-mechanism
● “Hacks” such as AJAX, Long Polling & Comet used to simulate real-time
● Introduction to WebSockets
● How WebSocket Protocol works ?
● HTTP Idempotent Methods
● WebSockets & RESTful Web Services
● HTTP Session Vs WebSocket Session
● Server-Push using WebSockets
● WebSocket Performance
● WebSocket Security
● JSR-356 Java WebSocket APIs
● Spring Framework 4.0 support for WebSocket & SockJS
Asynchronous
● Intro to Asynchronous Applications
● What is Non-Blocking I/O ?
● Problem spanning Threads in JEE App Servers
● Async support in Servlets 3.0
● Asynchronous Session EJB 3.1
● Asynchronous Beans in Spring Framework
Event-Driven
● What are Event-Driven Apps ?
● node.js : Server-side Javascript
● Vert.x : Event-Driven Java framework
Real-Time
What are Real-Time Web Applications ?
What are Real-Time Web Apps ?
The real-time web enables users to receive information as
soon as it is published.
Bi-directional two-way communication between users &
system
Both Pull & Push based systems.
Real-Time Web Apps Examples
The Real-Time Web application examples.
● Gmail
● ESPN Sports
● Gotomeetings
● Netflix (Perfect disaster recovery app )
Problems with HTTP
HTTP is the fundamental web protocol and problems with
HTTP are ......
● One-way
● request/response
● stateless
● Half-Duplex protocol
Real-time example
HTTP 1.1 keep-alive
HTTP 1.1 keep-alive-mechanism or persistent connection
Connection: Keep-Alive
Keep-Alive: timeout=10, max=5
● A connection that lasts beyond the current
request/response transaction.
● Client perform multiple requests without the overhead of
connection tear-down and set-up between each request.
● Fundamental web communication change.
Real-Time "Hacks"
With HTTP 1.1 keep-alive connections real-time "hacks" or
"simulations"
● Long Polling
● AJAX (XMLHTTPRequest & InnerHTML)
● HTTP Streaming
● Adobe Flash "RTMP Protocol"
● Apache COMET (Gmails GTalk)
AJAX request
How AJAX XMLHTTPRequest is different than regular HTTP
Request
window.open()
● HTTP Request browser will stop or hang for the server
response.
xmlhttp.open()
● With AJAX request is Async, the JavaScript does not have
to wait for the server response, but can instead execute
other scripts and respond to user events while waiting for
server response. Deal with the response when the
Problems with "Hacks"
Problem with real-time simulations
● HTTP Web Server timeouts, Proxy Server timeouts
● Too many connections
● Too much overhead
● Work around but not a native solution
HTTP Protocol is Still Not Real-time
HTTP 1.1 keep-alive-mechanism
has persistent connections ......
But not ..........
Full-Duplex Communication ...
Duplex Communication
What are Full Duplex Communication ?
Duplex Communication
What are Full-Duplex Communication ?
Allows communication in both directions and happens
simultaneously.
-Two lane road
-Telephone Lines
-LAN
-Mobile Networks
-Cable Networks
-Echo Cancellation issues
Duplex Communication
HTTP is a Half-Duplex Protocol
-Walkie-Talkie ("Over" command)
-One lane road with traffic controller at each end (Traffic flows
in both but only directions at a time)
Duplex Communication Quiz
1. TCP Protocol is a Full Duplex ?
2. Database Connection Full Duplex ?
3. Middleware MQ/JMS Connections ?
Duplex Communication Quiz
Difference Keep-alive & Full-Duplex
● A Keep Alive HTTP header since HTTP 1.0, which is used
to indicate a HTTP client would like to maintain a persistent
connection with HTTP server.
● The main objects is to eliminate the needs for opening TCP
connection for each HTTP request. However, while there is
a persistent connection open, the protocol for
communication between client and server is still following
the basic HTTP request/response pattern
● Full-duplex connection Server side can Push Data to
client and client should be expected to process data from
server side
Real-Time Web
Real-Time web applications needs two-way bi-directional and
Full Duplex communication.
So upgrade HTTP Protocol ?
Upgrade HTTP Protocol
Upgrade HTTP Protocol to Full Duplex Protocol
RFC6455 WebSocket Protocol
W3C standard on Dec 2011
WebSocket Protocol
What is WebSocket ?
WebSocket Protocol
● WebSocket is a Full Duplex Web Protocol
● Two-way messaging over single connection
● It is not a HTTP protocol
● Depends on HTTP Protocol for the initial bootstrap and
afterwards uses TCP Protocol
● Websocket differs from TCP in that it enables a stream of
messages instead of a stream of bytes.
WebSocket Protocol
● HTTP://server.com , WS://server.com
● HTTPS://server.com, WSS://server.com (Secured)
● Extremely Low-overhead
Real-Time App design
State Farm ADA - JEE Application Deployment tool
● ADA Current way
● ADA with "Hacks" long polling
● ADA with WebSocket
Form based Apps
● ADA is not a revenue generating application
● What about Insurance Quote ?
● What about Insurance Claims ?
WebSocket Applications
● Current web applications are "Form based" applications
targeting simple or happy path of the Business Process.
● Extending the scope of "Functional Requirements" to
capture the complete user experience (Customer
Collaboration)
● In the future many applications will be using WebSockets
WebSocket Performance
● Each HTTP Request/Response (header+body) have
minimum of 871 Bytes overhead.
● WebSocket frames has 2 Bytes of overhead
● 1000 HTTP Clients polling a second = 6.6Mbps Network
throughput
● 1000 WebSocket Clients receiving messages (1 second) =
0.015Mbps Network throughput
www.websocket.org
WebSocket Performance
WebSocket Performance
● Web Sockets can provide a 500:1 or depending on the size
of the HTTP headers or even a 1000:1 reduction in
unnecessary HTTP header traffic
● Minimum of 3:1 reduction in latency
● Significantly improves Network throughput and Request
latency www.websocket.org
WebSocket Fundamentals
How WebSocket Protocol works ?
WebSocket Handshake Request
WebSocket Handshake Request: To establish a WebSocket
connection, the client sends a WebSocket handshake request
ws://webserver.com/home
GET /mychat HTTP/1.1
Host: server.example.com
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Key: x3JJHMbDL1EzLkh9GBhXDw==
Sec-WebSocket-Protocol: chat
Sec-WebSocket-Version: 13
Origin: http://example.com
WebSocket Handshake Response
WebSocket Server Response: Server WebSocket handshake
response
HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Accept: HSmrc0sMlYUkAGmm5OPpG2HaGWk=
Sec-WebSocket-Protocol: chat
WebSocket Handshake
● The handshake resembles HTTP so that servers can
handle HTTP connections as well as WebSocket
connections on the same port.
● Once the connection is established, the client and server
can send WebSocket data or text frames back and forth in
full-duplex mode.
● The data is minimally framed, with a small header followed
by payload. WebSocket transmissions are described as
"messages"
WebSocket Extensions
● With extensions to the protocol, this can also be used for
multiplexing several streams simultaneously (for instance
to avoid monopolizing use of a socket for a single large
payload).
WebSocket Security
Same SSL/TLS based Security
WebSocket Applications
● Trading [Stocks, Biding Apps ebay.com]
● Chat [Gmail]
● Games
● Collaboration
● Dashboard Reports
● Visualization
WebSocket Applications
● Current web applications are "Form based" applications
targeting simple or happy path of the Business Process.
● Extending the scope of "Functional Requirements" to
capture the complete user experience (Customer
Collaboration)
● In the future many applications will be using WebSockets
WebSocket Java API
● JSR-356/JEE 7 Java WebSocket Annotation based API
javax.websocket.*
● Server Endpoint
@ServerEndpoint("/hello")
public class MyEndpoint { }
● Client Endpoint
@ClientEndpoint
public class MyClientEndpoint {}
WebSocket Java API
● Connection Open
@OnOpen
public void myOnOpen (Session session) { }
● On Message
@OnMessage
public String myOnMessage (String txt) { }
● Connection Close
@OnClose
public void myOnClose (CloseReason reason) { }
WebSocket Java API
● Zero or more string parameters annotated with
@PathParam, referring to path parameters on the endpoint
path
● Java WebSocket API provides encoders/decoders to use
custom Java object messages in the OnMessage()
● A javax.websocket.CloseReason parameter describing the
reason for closing the WebSocket, for example, normal
closure, protocol error, overloaded service, and so on
WebSocket Session vs HTTPSession
● WebSocket Session is closed after connection closes.
HTTPSession is destroyed based on server timeout
setting.
● The javax.websocket.Session parameter. Note that this
parameter cannot be used once the WebSocket is really
closed, which happens after the @OnClose annotated
method returns.
WebSocket Challenges
● RESTFul web services depend on the HTTP Methods such
as GET/POST but WebSocket does not have such
methods.
● HTTP Proxy Servers are used to monitor or close
connections, content caching, filtering and designed for
HTTP-based document transfer. Not for long-lived
connections
● Wireless connections, Server connections and Client
connections many fade. Handling lost connections.
● Frequent Server Sockets/Threads open & close. Max
64,000 Sockets per machine.
Spring Framework
● Spring Framework 4.0 supports WebSocket protocol.
● If browser does not support WebSocket the Spring
framework uses SockJS library to emulate the WebSockets
in the browsers.
Future of Web Protocol
● Google SPDY/HTTP 2.0
● WebRTC for peer-to-peer communication
● Installable Web Apps (App Store for Web Apps ?)
Google SPDY & WebRTC
● Google proposed Web Network protocol SPDY. Might be
part of HTTP 2.0
● Primary goal is to reduce Web page load latency. Achieved
through compression, multiplexing, and prioritization
● WebRTC is W3Cs peer-to-peer communication Protocol.
Google SPDY & WebRTC
Installable Web Application
● With low latency and improved browser functionality the
new generation of Javascript, HTML & CSS based
"Installable Web Application" similar to App Store are
emerging.
● Google Chrome Web Store
https://chrome.google.com/webstore/category/apps
● Firefox Marketplace
https://marketplace.firefox.com/developers/
Question and Answers
Questions ?????
Email Feedback Appreciated

More Related Content

What's hot

WEB SOCKET 應用
WEB SOCKET 應用WEB SOCKET 應用
WEB SOCKET 應用Jerromy Lee
 
WebSockets with Spring 4
WebSockets with Spring 4WebSockets with Spring 4
WebSockets with Spring 4
Sergi Almar i Graupera
 
Large scale web socket system with AWS and Web socket
Large scale web socket system with AWS and Web socketLarge scale web socket system with AWS and Web socket
Large scale web socket system with AWS and Web socket
Le Kien Truc
 
HTML5 WebSocket: The New Network Stack for the Web
HTML5 WebSocket: The New Network Stack for the WebHTML5 WebSocket: The New Network Stack for the Web
HTML5 WebSocket: The New Network Stack for the Web
Peter Lubbers
 
Php push notifications
Php push notificationsPhp push notifications
Php push notifications
Mohammed Shurrab
 
Introduction to WebSockets
Introduction to WebSocketsIntroduction to WebSockets
Introduction to WebSockets
Gunnar Hillert
 
vlavrynovych - WebSockets Presentation
vlavrynovych - WebSockets Presentationvlavrynovych - WebSockets Presentation
vlavrynovych - WebSockets PresentationVolodymyr Lavrynovych
 
Real time web (Orbited) at BCNE3
Real time web (Orbited) at BCNE3Real time web (Orbited) at BCNE3
Real time web (Orbited) at BCNE3
Alex Kavanagh
 
Using Websockets with Play!
Using Websockets with Play!Using Websockets with Play!
Using Websockets with Play!
Andrew Conner
 
HTML5 WebSocket Introduction
HTML5 WebSocket IntroductionHTML5 WebSocket Introduction
HTML5 WebSocket Introduction
Marcelo Jabali
 
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
Peter Lubbers
 
Websockets on the JVM: Atmosphere to the rescue!
Websockets on the JVM: Atmosphere to the rescue!Websockets on the JVM: Atmosphere to the rescue!
Websockets on the JVM: Atmosphere to the rescue!
jfarcand
 
WebSockets: The Current State of the Most Valuable HTML5 API for Java Developers
WebSockets: The Current State of the Most Valuable HTML5 API for Java DevelopersWebSockets: The Current State of the Most Valuable HTML5 API for Java Developers
WebSockets: The Current State of the Most Valuable HTML5 API for Java DevelopersViktor Gamov
 
Camelone-2012 HTML5 WebSocket ActiveMQ/Camel
Camelone-2012 HTML5 WebSocket ActiveMQ/CamelCamelone-2012 HTML5 WebSocket ActiveMQ/Camel
Camelone-2012 HTML5 WebSocket ActiveMQ/Camel
Charles Moulliard
 
Consuming ASP.NET Web API with WebSockets
Consuming ASP.NET Web API with WebSocketsConsuming ASP.NET Web API with WebSockets
Consuming ASP.NET Web API with WebSockets
Maayan Glikser
 
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)
Ericom Software
 
Using WebSockets with ColdFusion
Using WebSockets with ColdFusionUsing WebSockets with ColdFusion
Using WebSockets with ColdFusioncfjedimaster
 
Websockets at tossug
Websockets at tossugWebsockets at tossug
Websockets at tossugclkao
 

What's hot (20)

WEB SOCKET 應用
WEB SOCKET 應用WEB SOCKET 應用
WEB SOCKET 應用
 
Ws
WsWs
Ws
 
WebSockets with Spring 4
WebSockets with Spring 4WebSockets with Spring 4
WebSockets with Spring 4
 
Large scale web socket system with AWS and Web socket
Large scale web socket system with AWS and Web socketLarge scale web socket system with AWS and Web socket
Large scale web socket system with AWS and Web socket
 
HTML5 WebSocket: The New Network Stack for the Web
HTML5 WebSocket: The New Network Stack for the WebHTML5 WebSocket: The New Network Stack for the Web
HTML5 WebSocket: The New Network Stack for the Web
 
Php push notifications
Php push notificationsPhp push notifications
Php push notifications
 
Introduction to WebSockets
Introduction to WebSocketsIntroduction to WebSockets
Introduction to WebSockets
 
Intro to WebSockets
Intro to WebSocketsIntro to WebSockets
Intro to WebSockets
 
vlavrynovych - WebSockets Presentation
vlavrynovych - WebSockets Presentationvlavrynovych - WebSockets Presentation
vlavrynovych - WebSockets Presentation
 
Real time web (Orbited) at BCNE3
Real time web (Orbited) at BCNE3Real time web (Orbited) at BCNE3
Real time web (Orbited) at BCNE3
 
Using Websockets with Play!
Using Websockets with Play!Using Websockets with Play!
Using Websockets with Play!
 
HTML5 WebSocket Introduction
HTML5 WebSocket IntroductionHTML5 WebSocket Introduction
HTML5 WebSocket Introduction
 
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
 
Websockets on the JVM: Atmosphere to the rescue!
Websockets on the JVM: Atmosphere to the rescue!Websockets on the JVM: Atmosphere to the rescue!
Websockets on the JVM: Atmosphere to the rescue!
 
WebSockets: The Current State of the Most Valuable HTML5 API for Java Developers
WebSockets: The Current State of the Most Valuable HTML5 API for Java DevelopersWebSockets: The Current State of the Most Valuable HTML5 API for Java Developers
WebSockets: The Current State of the Most Valuable HTML5 API for Java Developers
 
Camelone-2012 HTML5 WebSocket ActiveMQ/Camel
Camelone-2012 HTML5 WebSocket ActiveMQ/CamelCamelone-2012 HTML5 WebSocket ActiveMQ/Camel
Camelone-2012 HTML5 WebSocket ActiveMQ/Camel
 
Consuming ASP.NET Web API with WebSockets
Consuming ASP.NET Web API with WebSocketsConsuming ASP.NET Web API with WebSockets
Consuming ASP.NET Web API with WebSockets
 
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)
 
Using WebSockets with ColdFusion
Using WebSockets with ColdFusionUsing WebSockets with ColdFusion
Using WebSockets with ColdFusion
 
Websockets at tossug
Websockets at tossugWebsockets at tossug
Websockets at tossug
 

Viewers also liked

Real time coding with jWebSocket
Real time coding with jWebSocketReal time coding with jWebSocket
Real time coding with jWebSocket
Victor Antonio Barzana
 
IoT and WebRTC
IoT and WebRTCIoT and WebRTC
IoT and WebRTC
Arin Sime
 
Introduction and overview ArangoDB query language AQL
Introduction and overview ArangoDB query language AQLIntroduction and overview ArangoDB query language AQL
Introduction and overview ArangoDB query language AQL
ArangoDB Database
 
Intro to Graph Databases Using Tinkerpop, TitanDB, and Gremlin
Intro to Graph Databases Using Tinkerpop, TitanDB, and GremlinIntro to Graph Databases Using Tinkerpop, TitanDB, and Gremlin
Intro to Graph Databases Using Tinkerpop, TitanDB, and Gremlin
Caleb Jones
 
Building a Next Generation Website
Building a Next Generation WebsiteBuilding a Next Generation Website
Building a Next Generation Website
Railslove
 
ItCamp2012-Real-Time-Web-Web-Sockets-Windows 8- Florin-Cardasim
ItCamp2012-Real-Time-Web-Web-Sockets-Windows 8- Florin-CardasimItCamp2012-Real-Time-Web-Web-Sockets-Windows 8- Florin-Cardasim
ItCamp2012-Real-Time-Web-Web-Sockets-Windows 8- Florin-CardasimFlorin Cardasim
 
Servlet Async I/O Proposal (NIO.2)
Servlet Async I/O Proposal (NIO.2)Servlet Async I/O Proposal (NIO.2)
Servlet Async I/O Proposal (NIO.2)
jfarcand
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed store
Anirban Sen Chowdhary
 
Angular mobile angular_u
Angular mobile angular_uAngular mobile angular_u
Angular mobile angular_u
Doris Chen
 
Developing Revolutionary Web Applications using Comet and Ajax Push
Developing Revolutionary Web Applications using Comet and Ajax PushDeveloping Revolutionary Web Applications using Comet and Ajax Push
Developing Revolutionary Web Applications using Comet and Ajax Push
Doris Chen
 
V2 peter-lubbers-sf-jug-websocket
V2 peter-lubbers-sf-jug-websocketV2 peter-lubbers-sf-jug-websocket
V2 peter-lubbers-sf-jug-websocketbrent bucci
 
Think async
Think asyncThink async
Think async
Bhakti Mehta
 
Router と WebSocket
Router と WebSocketRouter と WebSocket
Router と WebSocket
Kensaku Komatsu
 
WebSockets and Java
WebSockets and JavaWebSockets and Java
WebSockets and Java
Bozhidar Bozhanov
 
Asynchronous PHP and Real-time Messaging
Asynchronous PHP and Real-time MessagingAsynchronous PHP and Real-time Messaging
Asynchronous PHP and Real-time Messaging
Steve Rhoades
 
WebRTC applications for IoT
WebRTC applications for IoTWebRTC applications for IoT
WebRTC applications for IoT
Ivelin Ivanov
 
WebSocket MicroService vs. REST Microservice
WebSocket MicroService vs. REST MicroserviceWebSocket MicroService vs. REST Microservice
WebSocket MicroService vs. REST Microservice
Rick Hightower
 
Nuts and Bolts of WebSocket Devoxx 2014
Nuts and Bolts of WebSocket Devoxx 2014Nuts and Bolts of WebSocket Devoxx 2014
Nuts and Bolts of WebSocket Devoxx 2014
Arun Gupta
 
Real Time Recommendations Using WebSockets and Redis - Ninad Divadkar, Inuit
Real Time Recommendations Using WebSockets and Redis - Ninad Divadkar, InuitReal Time Recommendations Using WebSockets and Redis - Ninad Divadkar, Inuit
Real Time Recommendations Using WebSockets and Redis - Ninad Divadkar, Inuit
Redis Labs
 
From Push Technology to Real-Time Messaging and WebSockets
From Push Technology to Real-Time Messaging and WebSocketsFrom Push Technology to Real-Time Messaging and WebSockets
From Push Technology to Real-Time Messaging and WebSockets
Alessandro Alinone
 

Viewers also liked (20)

Real time coding with jWebSocket
Real time coding with jWebSocketReal time coding with jWebSocket
Real time coding with jWebSocket
 
IoT and WebRTC
IoT and WebRTCIoT and WebRTC
IoT and WebRTC
 
Introduction and overview ArangoDB query language AQL
Introduction and overview ArangoDB query language AQLIntroduction and overview ArangoDB query language AQL
Introduction and overview ArangoDB query language AQL
 
Intro to Graph Databases Using Tinkerpop, TitanDB, and Gremlin
Intro to Graph Databases Using Tinkerpop, TitanDB, and GremlinIntro to Graph Databases Using Tinkerpop, TitanDB, and Gremlin
Intro to Graph Databases Using Tinkerpop, TitanDB, and Gremlin
 
Building a Next Generation Website
Building a Next Generation WebsiteBuilding a Next Generation Website
Building a Next Generation Website
 
ItCamp2012-Real-Time-Web-Web-Sockets-Windows 8- Florin-Cardasim
ItCamp2012-Real-Time-Web-Web-Sockets-Windows 8- Florin-CardasimItCamp2012-Real-Time-Web-Web-Sockets-Windows 8- Florin-Cardasim
ItCamp2012-Real-Time-Web-Web-Sockets-Windows 8- Florin-Cardasim
 
Servlet Async I/O Proposal (NIO.2)
Servlet Async I/O Proposal (NIO.2)Servlet Async I/O Proposal (NIO.2)
Servlet Async I/O Proposal (NIO.2)
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed store
 
Angular mobile angular_u
Angular mobile angular_uAngular mobile angular_u
Angular mobile angular_u
 
Developing Revolutionary Web Applications using Comet and Ajax Push
Developing Revolutionary Web Applications using Comet and Ajax PushDeveloping Revolutionary Web Applications using Comet and Ajax Push
Developing Revolutionary Web Applications using Comet and Ajax Push
 
V2 peter-lubbers-sf-jug-websocket
V2 peter-lubbers-sf-jug-websocketV2 peter-lubbers-sf-jug-websocket
V2 peter-lubbers-sf-jug-websocket
 
Think async
Think asyncThink async
Think async
 
Router と WebSocket
Router と WebSocketRouter と WebSocket
Router と WebSocket
 
WebSockets and Java
WebSockets and JavaWebSockets and Java
WebSockets and Java
 
Asynchronous PHP and Real-time Messaging
Asynchronous PHP and Real-time MessagingAsynchronous PHP and Real-time Messaging
Asynchronous PHP and Real-time Messaging
 
WebRTC applications for IoT
WebRTC applications for IoTWebRTC applications for IoT
WebRTC applications for IoT
 
WebSocket MicroService vs. REST Microservice
WebSocket MicroService vs. REST MicroserviceWebSocket MicroService vs. REST Microservice
WebSocket MicroService vs. REST Microservice
 
Nuts and Bolts of WebSocket Devoxx 2014
Nuts and Bolts of WebSocket Devoxx 2014Nuts and Bolts of WebSocket Devoxx 2014
Nuts and Bolts of WebSocket Devoxx 2014
 
Real Time Recommendations Using WebSockets and Redis - Ninad Divadkar, Inuit
Real Time Recommendations Using WebSockets and Redis - Ninad Divadkar, InuitReal Time Recommendations Using WebSockets and Redis - Ninad Divadkar, Inuit
Real Time Recommendations Using WebSockets and Redis - Ninad Divadkar, Inuit
 
From Push Technology to Real-Time Messaging and WebSockets
From Push Technology to Real-Time Messaging and WebSocketsFrom Push Technology to Real-Time Messaging and WebSockets
From Push Technology to Real-Time Messaging and WebSockets
 

Similar to Building Next Generation Real-Time Web Applications using Websockets

JUG louvain websockets
JUG louvain websocketsJUG louvain websockets
JUG louvain websockets
Marc Tritschler
 
Decoding real time web communication
Decoding real time web communicationDecoding real time web communication
Decoding real time web communication
AMiT JAiN
 
Alex carcea, radu macovei a story of how java script joined the big league
Alex carcea, radu macovei   a story of how java script joined the big leagueAlex carcea, radu macovei   a story of how java script joined the big league
Alex carcea, radu macovei a story of how java script joined the big league
Codecamp Romania
 
Websocket
WebsocketWebsocket
Websocket
艾鍗科技
 
Web-Socket
Web-SocketWeb-Socket
Smart Gamma - Real-Time Web applications with PHP and Websocket.
Smart Gamma - Real-Time Web applications with PHP and Websocket.Smart Gamma - Real-Time Web applications with PHP and Websocket.
Smart Gamma - Real-Time Web applications with PHP and Websocket.
Evgeniy Kuzmin
 
Introduction to Web Sockets
Introduction to Web SocketsIntroduction to Web Sockets
Introduction to Web Sockets
Jumping Bean
 
ClientServer Websocket.pptx
ClientServer Websocket.pptxClientServer Websocket.pptx
ClientServer Websocket.pptx
MaxamedSheekhAmiin
 
Taking a Quantum Leap with Html 5 WebSocket
Taking a Quantum Leap with Html 5 WebSocketTaking a Quantum Leap with Html 5 WebSocket
Taking a Quantum Leap with Html 5 WebSocket
Shahriar Hyder
 
The HTML5 WebSocket API
The HTML5 WebSocket APIThe HTML5 WebSocket API
The HTML5 WebSocket API
David Lindkvist
 
Websocket
WebsocketWebsocket
WebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! FrameworkWebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! Framework
Fabio Tiriticco
 
Websocket
WebsocketWebsocket
Websocket
Masudul Haque
 
Esc 209 paper_doin
Esc 209 paper_doinEsc 209 paper_doin
Esc 209 paper_doin
Jonny Doin
 
Polling Techniques, Ajax, protocol Switching from Http to Websocket standard ...
Polling Techniques, Ajax, protocol Switching from Http to Websocket standard ...Polling Techniques, Ajax, protocol Switching from Http to Websocket standard ...
Polling Techniques, Ajax, protocol Switching from Http to Websocket standard ...Srikanth Reddy Pallerla
 
Comet / WebSocket Web Applications
Comet / WebSocket Web ApplicationsComet / WebSocket Web Applications
Comet / WebSocket Web Applications
Codemotion
 
.NET Conf 2022 - Networking in .NET 7
.NET Conf 2022 - Networking in .NET 7.NET Conf 2022 - Networking in .NET 7
.NET Conf 2022 - Networking in .NET 7
Karel Zikmund
 
DEV301- Web Service Programming with WCF 3.5
DEV301- Web Service Programming with WCF 3.5DEV301- Web Service Programming with WCF 3.5
DEV301- Web Service Programming with WCF 3.5Eyal Vardi
 
Real-Time with Flowdock
Real-Time with FlowdockReal-Time with Flowdock
Real-Time with Flowdock
Flowdock
 

Similar to Building Next Generation Real-Time Web Applications using Websockets (20)

JUG louvain websockets
JUG louvain websocketsJUG louvain websockets
JUG louvain websockets
 
Decoding real time web communication
Decoding real time web communicationDecoding real time web communication
Decoding real time web communication
 
Alex carcea, radu macovei a story of how java script joined the big league
Alex carcea, radu macovei   a story of how java script joined the big leagueAlex carcea, radu macovei   a story of how java script joined the big league
Alex carcea, radu macovei a story of how java script joined the big league
 
Websocket
WebsocketWebsocket
Websocket
 
Web-Socket
Web-SocketWeb-Socket
Web-Socket
 
Smart Gamma - Real-Time Web applications with PHP and Websocket.
Smart Gamma - Real-Time Web applications with PHP and Websocket.Smart Gamma - Real-Time Web applications with PHP and Websocket.
Smart Gamma - Real-Time Web applications with PHP and Websocket.
 
Introduction to Web Sockets
Introduction to Web SocketsIntroduction to Web Sockets
Introduction to Web Sockets
 
ClientServer Websocket.pptx
ClientServer Websocket.pptxClientServer Websocket.pptx
ClientServer Websocket.pptx
 
Taking a Quantum Leap with Html 5 WebSocket
Taking a Quantum Leap with Html 5 WebSocketTaking a Quantum Leap with Html 5 WebSocket
Taking a Quantum Leap with Html 5 WebSocket
 
The HTML5 WebSocket API
The HTML5 WebSocket APIThe HTML5 WebSocket API
The HTML5 WebSocket API
 
Websocket
WebsocketWebsocket
Websocket
 
WebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! FrameworkWebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! Framework
 
Websocket
WebsocketWebsocket
Websocket
 
Esc 209 paper_doin
Esc 209 paper_doinEsc 209 paper_doin
Esc 209 paper_doin
 
Servlet by Rj
Servlet by RjServlet by Rj
Servlet by Rj
 
Polling Techniques, Ajax, protocol Switching from Http to Websocket standard ...
Polling Techniques, Ajax, protocol Switching from Http to Websocket standard ...Polling Techniques, Ajax, protocol Switching from Http to Websocket standard ...
Polling Techniques, Ajax, protocol Switching from Http to Websocket standard ...
 
Comet / WebSocket Web Applications
Comet / WebSocket Web ApplicationsComet / WebSocket Web Applications
Comet / WebSocket Web Applications
 
.NET Conf 2022 - Networking in .NET 7
.NET Conf 2022 - Networking in .NET 7.NET Conf 2022 - Networking in .NET 7
.NET Conf 2022 - Networking in .NET 7
 
DEV301- Web Service Programming with WCF 3.5
DEV301- Web Service Programming with WCF 3.5DEV301- Web Service Programming with WCF 3.5
DEV301- Web Service Programming with WCF 3.5
 
Real-Time with Flowdock
Real-Time with FlowdockReal-Time with Flowdock
Real-Time with Flowdock
 

More from Naresh Chintalcheru

Cars.com Journey to AWS Cloud
Cars.com Journey to AWS CloudCars.com Journey to AWS Cloud
Cars.com Journey to AWS Cloud
Naresh Chintalcheru
 
Bimodal IT for Speed and Innovation
Bimodal IT for Speed and InnovationBimodal IT for Speed and Innovation
Bimodal IT for Speed and Innovation
Naresh Chintalcheru
 
Reactive systems
Reactive systemsReactive systems
Reactive systems
Naresh Chintalcheru
 
Introduction to Node.js Platform
Introduction to Node.js PlatformIntroduction to Node.js Platform
Introduction to Node.js Platform
Naresh Chintalcheru
 
3rd Generation Web Application Platforms
3rd Generation Web Application Platforms3rd Generation Web Application Platforms
3rd Generation Web Application Platforms
Naresh Chintalcheru
 
Asynchronous Processing in Java/JEE/Spring
Asynchronous Processing in Java/JEE/SpringAsynchronous Processing in Java/JEE/Spring
Asynchronous Processing in Java/JEE/Spring
Naresh Chintalcheru
 
Problems opening SOA to the Online Web Applications
Problems opening SOA to the Online Web ApplicationsProblems opening SOA to the Online Web Applications
Problems opening SOA to the Online Web Applications
Naresh Chintalcheru
 
Lie Cheat & Steal to build Hyper-Fast Applications using Event-Driven Archite...
Lie Cheat & Steal to build Hyper-Fast Applications using Event-Driven Archite...Lie Cheat & Steal to build Hyper-Fast Applications using Event-Driven Archite...
Lie Cheat & Steal to build Hyper-Fast Applications using Event-Driven Archite...
Naresh Chintalcheru
 
Java7 New Features and Code Examples
Java7 New Features and Code ExamplesJava7 New Features and Code Examples
Java7 New Features and Code Examples
Naresh Chintalcheru
 
Big Trends in Big Data
Big Trends in Big DataBig Trends in Big Data
Big Trends in Big Data
Naresh Chintalcheru
 
Design & Develop Batch Applications in Java/JEE
Design & Develop Batch Applications in Java/JEEDesign & Develop Batch Applications in Java/JEE
Design & Develop Batch Applications in Java/JEE
Naresh Chintalcheru
 
Mule ESB Fundamentals
Mule ESB FundamentalsMule ESB Fundamentals
Mule ESB Fundamentals
Naresh Chintalcheru
 
Automation Testing using Selenium
Automation Testing using SeleniumAutomation Testing using Selenium
Automation Testing using Selenium
Naresh Chintalcheru
 
Design & Development of Web Applications using SpringMVC
Design & Development of Web Applications using SpringMVC Design & Development of Web Applications using SpringMVC
Design & Development of Web Applications using SpringMVC
Naresh Chintalcheru
 
Android Platform Architecture
Android Platform ArchitectureAndroid Platform Architecture
Android Platform Architecture
Naresh Chintalcheru
 
Object-Oriented Polymorphism Unleashed
Object-Oriented Polymorphism UnleashedObject-Oriented Polymorphism Unleashed
Object-Oriented Polymorphism Unleashed
Naresh Chintalcheru
 

More from Naresh Chintalcheru (16)

Cars.com Journey to AWS Cloud
Cars.com Journey to AWS CloudCars.com Journey to AWS Cloud
Cars.com Journey to AWS Cloud
 
Bimodal IT for Speed and Innovation
Bimodal IT for Speed and InnovationBimodal IT for Speed and Innovation
Bimodal IT for Speed and Innovation
 
Reactive systems
Reactive systemsReactive systems
Reactive systems
 
Introduction to Node.js Platform
Introduction to Node.js PlatformIntroduction to Node.js Platform
Introduction to Node.js Platform
 
3rd Generation Web Application Platforms
3rd Generation Web Application Platforms3rd Generation Web Application Platforms
3rd Generation Web Application Platforms
 
Asynchronous Processing in Java/JEE/Spring
Asynchronous Processing in Java/JEE/SpringAsynchronous Processing in Java/JEE/Spring
Asynchronous Processing in Java/JEE/Spring
 
Problems opening SOA to the Online Web Applications
Problems opening SOA to the Online Web ApplicationsProblems opening SOA to the Online Web Applications
Problems opening SOA to the Online Web Applications
 
Lie Cheat & Steal to build Hyper-Fast Applications using Event-Driven Archite...
Lie Cheat & Steal to build Hyper-Fast Applications using Event-Driven Archite...Lie Cheat & Steal to build Hyper-Fast Applications using Event-Driven Archite...
Lie Cheat & Steal to build Hyper-Fast Applications using Event-Driven Archite...
 
Java7 New Features and Code Examples
Java7 New Features and Code ExamplesJava7 New Features and Code Examples
Java7 New Features and Code Examples
 
Big Trends in Big Data
Big Trends in Big DataBig Trends in Big Data
Big Trends in Big Data
 
Design & Develop Batch Applications in Java/JEE
Design & Develop Batch Applications in Java/JEEDesign & Develop Batch Applications in Java/JEE
Design & Develop Batch Applications in Java/JEE
 
Mule ESB Fundamentals
Mule ESB FundamentalsMule ESB Fundamentals
Mule ESB Fundamentals
 
Automation Testing using Selenium
Automation Testing using SeleniumAutomation Testing using Selenium
Automation Testing using Selenium
 
Design & Development of Web Applications using SpringMVC
Design & Development of Web Applications using SpringMVC Design & Development of Web Applications using SpringMVC
Design & Development of Web Applications using SpringMVC
 
Android Platform Architecture
Android Platform ArchitectureAndroid Platform Architecture
Android Platform Architecture
 
Object-Oriented Polymorphism Unleashed
Object-Oriented Polymorphism UnleashedObject-Oriented Polymorphism Unleashed
Object-Oriented Polymorphism Unleashed
 

Recently uploaded

How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 

Recently uploaded (20)

How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 

Building Next Generation Real-Time Web Applications using Websockets

  • 1. Building Next Generation Real-Time Web Applications - Naresh Chintalcheru
  • 2. Real-Time ● What are Real-Time Web Apps ? ● HTTP Half-Duplex to Full-Duplex WebSocket (WS) Protocol ● HTTP 1.1 keep-alive-mechanism ● “Hacks” such as AJAX, Long Polling & Comet used to simulate real-time ● Introduction to WebSockets ● How WebSocket Protocol works ? ● HTTP Idempotent Methods ● WebSockets & RESTful Web Services ● HTTP Session Vs WebSocket Session ● Server-Push using WebSockets ● WebSocket Performance ● WebSocket Security ● JSR-356 Java WebSocket APIs ● Spring Framework 4.0 support for WebSocket & SockJS
  • 3. Asynchronous ● Intro to Asynchronous Applications ● What is Non-Blocking I/O ? ● Problem spanning Threads in JEE App Servers ● Async support in Servlets 3.0 ● Asynchronous Session EJB 3.1 ● Asynchronous Beans in Spring Framework
  • 4. Event-Driven ● What are Event-Driven Apps ? ● node.js : Server-side Javascript ● Vert.x : Event-Driven Java framework
  • 5. Real-Time What are Real-Time Web Applications ?
  • 6. What are Real-Time Web Apps ? The real-time web enables users to receive information as soon as it is published. Bi-directional two-way communication between users & system Both Pull & Push based systems.
  • 7. Real-Time Web Apps Examples The Real-Time Web application examples. ● Gmail ● ESPN Sports ● Gotomeetings ● Netflix (Perfect disaster recovery app )
  • 8. Problems with HTTP HTTP is the fundamental web protocol and problems with HTTP are ...... ● One-way ● request/response ● stateless ● Half-Duplex protocol Real-time example
  • 9. HTTP 1.1 keep-alive HTTP 1.1 keep-alive-mechanism or persistent connection Connection: Keep-Alive Keep-Alive: timeout=10, max=5 ● A connection that lasts beyond the current request/response transaction. ● Client perform multiple requests without the overhead of connection tear-down and set-up between each request. ● Fundamental web communication change.
  • 10. Real-Time "Hacks" With HTTP 1.1 keep-alive connections real-time "hacks" or "simulations" ● Long Polling ● AJAX (XMLHTTPRequest & InnerHTML) ● HTTP Streaming ● Adobe Flash "RTMP Protocol" ● Apache COMET (Gmails GTalk)
  • 11. AJAX request How AJAX XMLHTTPRequest is different than regular HTTP Request window.open() ● HTTP Request browser will stop or hang for the server response. xmlhttp.open() ● With AJAX request is Async, the JavaScript does not have to wait for the server response, but can instead execute other scripts and respond to user events while waiting for server response. Deal with the response when the
  • 12. Problems with "Hacks" Problem with real-time simulations ● HTTP Web Server timeouts, Proxy Server timeouts ● Too many connections ● Too much overhead ● Work around but not a native solution
  • 13. HTTP Protocol is Still Not Real-time HTTP 1.1 keep-alive-mechanism has persistent connections ...... But not .......... Full-Duplex Communication ...
  • 14. Duplex Communication What are Full Duplex Communication ?
  • 15. Duplex Communication What are Full-Duplex Communication ? Allows communication in both directions and happens simultaneously. -Two lane road -Telephone Lines -LAN -Mobile Networks -Cable Networks -Echo Cancellation issues
  • 16. Duplex Communication HTTP is a Half-Duplex Protocol -Walkie-Talkie ("Over" command) -One lane road with traffic controller at each end (Traffic flows in both but only directions at a time)
  • 17. Duplex Communication Quiz 1. TCP Protocol is a Full Duplex ? 2. Database Connection Full Duplex ? 3. Middleware MQ/JMS Connections ?
  • 19. Difference Keep-alive & Full-Duplex ● A Keep Alive HTTP header since HTTP 1.0, which is used to indicate a HTTP client would like to maintain a persistent connection with HTTP server. ● The main objects is to eliminate the needs for opening TCP connection for each HTTP request. However, while there is a persistent connection open, the protocol for communication between client and server is still following the basic HTTP request/response pattern ● Full-duplex connection Server side can Push Data to client and client should be expected to process data from server side
  • 20. Real-Time Web Real-Time web applications needs two-way bi-directional and Full Duplex communication. So upgrade HTTP Protocol ?
  • 21. Upgrade HTTP Protocol Upgrade HTTP Protocol to Full Duplex Protocol RFC6455 WebSocket Protocol W3C standard on Dec 2011
  • 23. WebSocket Protocol ● WebSocket is a Full Duplex Web Protocol ● Two-way messaging over single connection ● It is not a HTTP protocol ● Depends on HTTP Protocol for the initial bootstrap and afterwards uses TCP Protocol ● Websocket differs from TCP in that it enables a stream of messages instead of a stream of bytes.
  • 24. WebSocket Protocol ● HTTP://server.com , WS://server.com ● HTTPS://server.com, WSS://server.com (Secured) ● Extremely Low-overhead
  • 25. Real-Time App design State Farm ADA - JEE Application Deployment tool ● ADA Current way ● ADA with "Hacks" long polling ● ADA with WebSocket
  • 26. Form based Apps ● ADA is not a revenue generating application ● What about Insurance Quote ? ● What about Insurance Claims ?
  • 27. WebSocket Applications ● Current web applications are "Form based" applications targeting simple or happy path of the Business Process. ● Extending the scope of "Functional Requirements" to capture the complete user experience (Customer Collaboration) ● In the future many applications will be using WebSockets
  • 28. WebSocket Performance ● Each HTTP Request/Response (header+body) have minimum of 871 Bytes overhead. ● WebSocket frames has 2 Bytes of overhead ● 1000 HTTP Clients polling a second = 6.6Mbps Network throughput ● 1000 WebSocket Clients receiving messages (1 second) = 0.015Mbps Network throughput www.websocket.org
  • 30. WebSocket Performance ● Web Sockets can provide a 500:1 or depending on the size of the HTTP headers or even a 1000:1 reduction in unnecessary HTTP header traffic ● Minimum of 3:1 reduction in latency ● Significantly improves Network throughput and Request latency www.websocket.org
  • 32. WebSocket Handshake Request WebSocket Handshake Request: To establish a WebSocket connection, the client sends a WebSocket handshake request ws://webserver.com/home GET /mychat HTTP/1.1 Host: server.example.com Upgrade: websocket Connection: Upgrade Sec-WebSocket-Key: x3JJHMbDL1EzLkh9GBhXDw== Sec-WebSocket-Protocol: chat Sec-WebSocket-Version: 13 Origin: http://example.com
  • 33. WebSocket Handshake Response WebSocket Server Response: Server WebSocket handshake response HTTP/1.1 101 Switching Protocols Upgrade: websocket Connection: Upgrade Sec-WebSocket-Accept: HSmrc0sMlYUkAGmm5OPpG2HaGWk= Sec-WebSocket-Protocol: chat
  • 34. WebSocket Handshake ● The handshake resembles HTTP so that servers can handle HTTP connections as well as WebSocket connections on the same port. ● Once the connection is established, the client and server can send WebSocket data or text frames back and forth in full-duplex mode. ● The data is minimally framed, with a small header followed by payload. WebSocket transmissions are described as "messages"
  • 35. WebSocket Extensions ● With extensions to the protocol, this can also be used for multiplexing several streams simultaneously (for instance to avoid monopolizing use of a socket for a single large payload).
  • 37. WebSocket Applications ● Trading [Stocks, Biding Apps ebay.com] ● Chat [Gmail] ● Games ● Collaboration ● Dashboard Reports ● Visualization
  • 38. WebSocket Applications ● Current web applications are "Form based" applications targeting simple or happy path of the Business Process. ● Extending the scope of "Functional Requirements" to capture the complete user experience (Customer Collaboration) ● In the future many applications will be using WebSockets
  • 39. WebSocket Java API ● JSR-356/JEE 7 Java WebSocket Annotation based API javax.websocket.* ● Server Endpoint @ServerEndpoint("/hello") public class MyEndpoint { } ● Client Endpoint @ClientEndpoint public class MyClientEndpoint {}
  • 40. WebSocket Java API ● Connection Open @OnOpen public void myOnOpen (Session session) { } ● On Message @OnMessage public String myOnMessage (String txt) { } ● Connection Close @OnClose public void myOnClose (CloseReason reason) { }
  • 41. WebSocket Java API ● Zero or more string parameters annotated with @PathParam, referring to path parameters on the endpoint path ● Java WebSocket API provides encoders/decoders to use custom Java object messages in the OnMessage() ● A javax.websocket.CloseReason parameter describing the reason for closing the WebSocket, for example, normal closure, protocol error, overloaded service, and so on
  • 42. WebSocket Session vs HTTPSession ● WebSocket Session is closed after connection closes. HTTPSession is destroyed based on server timeout setting. ● The javax.websocket.Session parameter. Note that this parameter cannot be used once the WebSocket is really closed, which happens after the @OnClose annotated method returns.
  • 43. WebSocket Challenges ● RESTFul web services depend on the HTTP Methods such as GET/POST but WebSocket does not have such methods. ● HTTP Proxy Servers are used to monitor or close connections, content caching, filtering and designed for HTTP-based document transfer. Not for long-lived connections ● Wireless connections, Server connections and Client connections many fade. Handling lost connections. ● Frequent Server Sockets/Threads open & close. Max 64,000 Sockets per machine.
  • 44. Spring Framework ● Spring Framework 4.0 supports WebSocket protocol. ● If browser does not support WebSocket the Spring framework uses SockJS library to emulate the WebSockets in the browsers.
  • 45. Future of Web Protocol ● Google SPDY/HTTP 2.0 ● WebRTC for peer-to-peer communication ● Installable Web Apps (App Store for Web Apps ?)
  • 46. Google SPDY & WebRTC ● Google proposed Web Network protocol SPDY. Might be part of HTTP 2.0 ● Primary goal is to reduce Web page load latency. Achieved through compression, multiplexing, and prioritization ● WebRTC is W3Cs peer-to-peer communication Protocol.
  • 47. Google SPDY & WebRTC
  • 48. Installable Web Application ● With low latency and improved browser functionality the new generation of Javascript, HTML & CSS based "Installable Web Application" similar to App Store are emerging. ● Google Chrome Web Store https://chrome.google.com/webstore/category/apps ● Firefox Marketplace https://marketplace.firefox.com/developers/
  • 49. Question and Answers Questions ????? Email Feedback Appreciated