SlideShare a Scribd company logo
API Design and WebSocket 
WoT Next? 
@frankgreco
Background 
§ Director of Technology @ Kaazing 
§ Chairman NYJavaSIG (javasig.com) 
§ Largest JUG in North America 
8,000+ members 
§ Financial Services, Architecture, Cloud 
§ frank.greco@kaazing.com, @frankgreco
A Primary Tenet of Computing 
History 
History 
If History Repeats Itself, Is There No Future?
A Trip Down Memory Lane… 
In the beginning…
Enterprise – “inside the firewall” (1980’s – early 90’s) 
tcp 
Client-Server
Web – “over the firewall” (early 90’s – 2011) 
http tcp 
web server 
and/or 
app server 
app protocols 
Not efficient or effective for event-based systems…
But Modern Applications are Dynamic and Event-based 
FX trading 
Monitoring 
Stock trading Utilities trading 
XaaS 
Logistics Notification Compliance 
Betting & bidding 
Voting In-store & online Collaboration
Legacy Web 
u Designed for document transfer – HTTP 
ü Short-lived Request / Response interaction 
u Bidirectional, but half-duplex 
ü Traffic flows in only one direction at a time 
u Stateless 
ü Large amounts of metadata resent for each 
request 
The Web was not originally designed for 
“real-time”, event-based services…
WebSocket – “TCP for the Web” 
u IETF Protocol and W3C JavaScript API for real-time, 
bi-directional, always-on connections 
u RFC 6455 – Dec 2011 
u Easily add event-based data to web apps 
ü ws://mycompany.com/collaboration_svc 
ü wss://anothercompany.com/marketdata 
u Avoids polling 
u Avoids HTTP meta-data overhead 
u Shares port with HTTP (80/443) 
u Traverses Firewalls
The WebSocket Handshake
For Event-based Web Communication… 
Legacy HTTP vs WebSocket 
http:// ws:// 
u Application-level Socket over the Web 
u Supported by all Modern Browsers 
u Event-based Applications
W3C WebSocket JavaScript API
W3C WebSocket JavaScript API 
HTML5 WebSocket API 
But… 
Dealing with WebSocket is like dealing with TCP. 
It’s a streams-based model. You need to understand how to 
handle streams-based data over the wire. 
e.g., How do I do publish/subscribe?
What is Missing? 
Where is the Application-level Protocol? 
Who handles retries? 
How do we handle publish/ 
subscribe semantics? 
How do we handle market data? 
How can we guarantee delivery? 
What do we do with slow 
consumers, last value cache, etc? 
What if the client is not 
currently active? 
What about partial data? 
How do I handle 
entitlements? ACL?
Browser and Native Applications 
JMS XMPP AMQP B2B FTP VNC MQTT etc 
WebSocket 
TCP/IP 
Internet 
WebSocket 
Gateway 
WebSocket 
Gateway 
Protocol Layering is Possible 
WebSocket is a 
Transport layer
Simplicity is a 
Useful 
Abstraction! 
Simplicity enables 
Innovation 
Complexity 
Innovation 
Higher Level APIs Reduce Complexity
Higher Level APIs (over WebSocket) for JavaScript 
So if you can layer application protocols and 
APIs over WebSocket, what do you have? 
u Easier WebSocket programmability 
u Event-driven applications over the web 
u Event-driven APIs over the web 
u Not necessary to open non-standard ports 
u Web infrastructure now truly “disappears” 
u Reduction in complexity 
u Further opportunities to innovate 
u Mobile + cloud + HTML5/WebSocket 
u Internet of Things -> Web of Things 
u “Imagination is Everything”
Publish/Subscribe 
Java Message Service (JMS) 
over 
WebSocket 
For Example…
Java Message Service (JMS) 
u Java EE Message Oriented Middleware 
u JMS 1.0 2001, JMS 1.1 2002, JMS 2.0 2013 
u Asynchronous Messaging vs. RPC 
u Loosely coupled vs. Tightly coupled 
u Pub/Sub, Topics, Queues 
u Transactions, Reliable
Basic JMS 
conn = createConnection(); 
sess = conn.createSession(); 
topic = jndiContext.lookup(topic); 
pub = sess.createProducer(topic); 
pub.send(“hey Frank”); 
conn = createConnection(); 
sess = conn.createSession(); 
topic = jndiContext.lookup(topic); 
sub = sess.createConsumer(topic); 
sub.setMessageListener(this); 
… 
public void onMessage(Message m) { 
String s = m.getText(); 
… do stuff… 
} 
conn = createConnection(); 
sess = conn.createSession(); 
topic = jndiContext.lookup(topic); 
sub = sess.createConsumer(topic); 
sub.setMessageListener(this); 
… 
public void onMessage(Message m) { 
String s = m.getText(); 
… do stuff… 
} 
conn = createConnection(); 
sess = conn.createSession(); 
topic = jndiContext.lookup(topic); 
sub = sess.createConsumer(topic); 
sub.setMessageListener(this); 
… 
public void onMessage(Message m) { 
String s = m.getText(); 
… do stuff… 
} 
msg 
broker
JMS Over the Web (JavaScript) 
Browser app - 100 msg/sec 
over port 80/443
What WebSocket is Not 
u It is not a New AJAX 
AJAX was a lovable hack 
u It is not a Push mechanism 
WebSocket is full-duplex, bi-directional 
u It is not a Messaging system 
It’s an agnostic wire protocol 
It’s a low-level transport API 
u It is not a Replacement for HTTP 
HTTP is still great for static, cacheable info
What’s next for WebSocket?
Internet of Things (IoT) 
+ 
Heterogeneity + Scale + Usability 
Futures
The World is Naturally Event-based (“real-time”) 
Presentation Music 
Communication 
Logistics 
Big 
Data 
Risk 
Management 
Home 
Security 
Health 
Monitoring 
Intelligent 
Appliances 
Local 
Transportation 
Monitoring/ 
Management 
Remote 
control
Let’s Take 1 Step Back to go 2 Steps Ahead… 
u Internet – Global system of interconnected networks 
that use IP to communicate 
u Internetworking – Connecting one network with another 
through a series of Gateways that provide a common 
method of communication
The Web 
u A popular application service on the Internet 
u Based on TCP/IP 
u Advantages 
§ Application deployment simplified – URI 
§ Interoperable open standards and specifications 
§ Ease of programmability – scripting 
§ Global reach and Economy of scale 
§ Accessed by ubiquitous Browsers and also non-Browsers 
u Two major protocols 
HTTP (1988/1999) and WebSocket (2007/2011)
The Hidden Web – Most of the Web is Not Visible 
browsers 
APIs 
http://thumbs.dreamstime.com/x/iceberg-23503494.jpg
Now… IoT, IIoT and M2M 
u A riff on “Ubiquitous Computing” (“Pervasive”) 
• Mark Weisner PARC 1988 
u Its early so there’s different definitions 
• Similar to early days of Cloud Computing 
u M2M has been around for decades. 
• Primarily proprietary embedded systems and typically 
point-to-point (RPC) 
u IoT/IIoT (Industrial IoT) 
• Adds Internet connectivity 
• Networks of M2M systems connected via IP
IoT/IIoT – Connectivity isn’t Sufficient 
u No formal API standards 
u Many protocol standards – interoperability low 
u No common, wide-reaching frameworks 
u No composition possibilities 
u Difficult to leverage economies of scale 
u Barrier to entry is high for millions of app developers 
u Also… we’re in a cloud, mobile, web api world
u IoT – Internet of Things 
• Embedded computing endowed with Internet connectivity 
u WoT – Web of Things 
• Application and Services layer over IoT 
Developers! 
u Apply the benefits of the Web to IoT 
u WoT is a uniform interface to access IoT functionality 
u Provides the abstraction for control/monitoring (sensors/ 
actuators) 
u Accelerates innovation 
u Deployment, development, interoperability, economy of 
scale… 
IoT 
WoT 
Here’s Where the Web Comes In
But Is HTTP the Right Choice? 
u Disadvantages of HTTP Request/Response 
u Lack of resiliency and robustness 
u Enterprise events retrieved by resource intensive polling 
techniques 
• Much bandwidth is wasted 
• Information can be delayed 
u Composite services brittle and lack transactionality 
u Enterprises learned advantages of ESB 10+ years ago 
u See failures of CORBA, Sun RPC, etc. 
u Clumsy AJAX/Comet workarounds to simulate real-time
History Repeats Itself… 
RPC 
Asynchronous 
RPC 
Messaging 
REST 
Asynchronous 
REST 
Messaging 
ESB ISB? 
Enterprise Web/WoT 
• Can wait for response 
• Tight coupling 
• Centralized business 
processes 
• Vertical interaction 
• Easy to understand (xact) 
• Future response 
• Loose coupling 
• Independent business 
processes 
• More complexity (xact) 
Did I mention History repeats itself?...
The Message is the Medium 
“…terse, self-classified 
messages, networking overhead 
isolated to a specialized tier of 
devices, and publish/subscribe 
relationships are the only way 
to fully distill the power of the 
coming Internet of Things” – 
Francis daCosta
Typically an App 
Server and DB 
App Server is 
probably not the 
right 
architecture 
Data Flow – Human Web vs WoT 
Human 
Web 
WoT 
Large data to client 
Small data to server 
Do human-readable protocols make sense for non-humans?
GW 
GW 
GW 
IoT/IIoT 
WoT 
WoT 
WoT 
Event Gateway Architecture
Event Gateway Architecture – Future Directions 
GW 
GW 
GW 
GW 
GW 
GW 
Aggregator nodes 
GW 
• Scalability 
• Querying 
• Performance 
• Manageability 
• Composition 
• Circles of Trust 
• Event processing 
• CDN++
Demos 
Click to Edit Master Title Style
Thank You! 
@frankgreco

More Related Content

What's hot

Overview of API Management Architectures
Overview of API Management ArchitecturesOverview of API Management Architectures
Overview of API Management Architectures
Nordic APIs
 
Async API and Solace: Enabling the Event-Driven Future
Async API and Solace: Enabling the Event-Driven FutureAsync API and Solace: Enabling the Event-Driven Future
Async API and Solace: Enabling the Event-Driven Future
Solace
 
Cloud Migration: A How-To Guide
Cloud Migration: A How-To GuideCloud Migration: A How-To Guide
Cloud Migration: A How-To Guide
Amazon Web Services
 
Istio Service Mesh
Istio Service MeshIstio Service Mesh
Istio Service Mesh
Luke Marsden
 
APIs with Bounded Contexts: Modelling Apis with Domain-Driven Design
APIs with Bounded Contexts: Modelling Apis with Domain-Driven DesignAPIs with Bounded Contexts: Modelling Apis with Domain-Driven Design
APIs with Bounded Contexts: Modelling Apis with Domain-Driven Design
José Haro Peralta
 
API for Beginners
API for BeginnersAPI for Beginners
API for Beginners
Gustavo De Vita
 
The Patterns of Distributed Logging and Containers
The Patterns of Distributed Logging and ContainersThe Patterns of Distributed Logging and Containers
The Patterns of Distributed Logging and Containers
SATOSHI TAGOMORI
 
API Strategy Introduction
API Strategy IntroductionAPI Strategy Introduction
API Strategy Introduction
Doug Gregory
 
Apache Bigtop: a crash course in deploying a Hadoop bigdata management platform
Apache Bigtop: a crash course in deploying a Hadoop bigdata management platformApache Bigtop: a crash course in deploying a Hadoop bigdata management platform
Apache Bigtop: a crash course in deploying a Hadoop bigdata management platform
rhatr
 
API Management Solution Powerpoint Presentation Slides
API Management Solution Powerpoint Presentation SlidesAPI Management Solution Powerpoint Presentation Slides
API Management Solution Powerpoint Presentation Slides
SlideTeam
 
What's an api
What's an apiWhat's an api
What's an api
Jacques Ledoux
 
What is an API Gateway?
What is an API Gateway?What is an API Gateway?
What is an API Gateway?
LunchBadger
 
ZgPHP 97 - Microservice architecture in Laravel
ZgPHP 97 - Microservice architecture in LaravelZgPHP 97 - Microservice architecture in Laravel
ZgPHP 97 - Microservice architecture in Laravel
Frano Šašvari
 
Implementing SRE practices: SLI/SLO deep dive - David Blank-Edelman - DevOpsD...
Implementing SRE practices: SLI/SLO deep dive - David Blank-Edelman - DevOpsD...Implementing SRE practices: SLI/SLO deep dive - David Blank-Edelman - DevOpsD...
Implementing SRE practices: SLI/SLO deep dive - David Blank-Edelman - DevOpsD...
DevOpsDays Tel Aviv
 
Hashicorp Corporate Pitch Deck Stenio_v2
Hashicorp Corporate Pitch Deck Stenio_v2 Hashicorp Corporate Pitch Deck Stenio_v2
Hashicorp Corporate Pitch Deck Stenio_v2
Stenio Ferreira
 
How Discord Migrated Trillions of Messages from Cassandra to ScyllaDB
How Discord Migrated Trillions of Messages from Cassandra to ScyllaDBHow Discord Migrated Trillions of Messages from Cassandra to ScyllaDB
How Discord Migrated Trillions of Messages from Cassandra to ScyllaDB
ScyllaDB
 
Running and Managing Mule Applications
Running and Managing Mule ApplicationsRunning and Managing Mule Applications
Running and Managing Mule Applications
MuleSoft
 
WSO2 API Platform: Vision and Roadmap
WSO2 API Platform: Vision and RoadmapWSO2 API Platform: Vision and Roadmap
WSO2 API Platform: Vision and Roadmap
WSO2
 
Building microservices with grpc
Building microservices with grpcBuilding microservices with grpc
Building microservices with grpc
Sathiyaseelan Muthu kumar
 
What do you mean by “API as a Product”?
What do you mean by “API as a Product”?What do you mean by “API as a Product”?
What do you mean by “API as a Product”?
Nordic APIs
 

What's hot (20)

Overview of API Management Architectures
Overview of API Management ArchitecturesOverview of API Management Architectures
Overview of API Management Architectures
 
Async API and Solace: Enabling the Event-Driven Future
Async API and Solace: Enabling the Event-Driven FutureAsync API and Solace: Enabling the Event-Driven Future
Async API and Solace: Enabling the Event-Driven Future
 
Cloud Migration: A How-To Guide
Cloud Migration: A How-To GuideCloud Migration: A How-To Guide
Cloud Migration: A How-To Guide
 
Istio Service Mesh
Istio Service MeshIstio Service Mesh
Istio Service Mesh
 
APIs with Bounded Contexts: Modelling Apis with Domain-Driven Design
APIs with Bounded Contexts: Modelling Apis with Domain-Driven DesignAPIs with Bounded Contexts: Modelling Apis with Domain-Driven Design
APIs with Bounded Contexts: Modelling Apis with Domain-Driven Design
 
API for Beginners
API for BeginnersAPI for Beginners
API for Beginners
 
The Patterns of Distributed Logging and Containers
The Patterns of Distributed Logging and ContainersThe Patterns of Distributed Logging and Containers
The Patterns of Distributed Logging and Containers
 
API Strategy Introduction
API Strategy IntroductionAPI Strategy Introduction
API Strategy Introduction
 
Apache Bigtop: a crash course in deploying a Hadoop bigdata management platform
Apache Bigtop: a crash course in deploying a Hadoop bigdata management platformApache Bigtop: a crash course in deploying a Hadoop bigdata management platform
Apache Bigtop: a crash course in deploying a Hadoop bigdata management platform
 
API Management Solution Powerpoint Presentation Slides
API Management Solution Powerpoint Presentation SlidesAPI Management Solution Powerpoint Presentation Slides
API Management Solution Powerpoint Presentation Slides
 
What's an api
What's an apiWhat's an api
What's an api
 
What is an API Gateway?
What is an API Gateway?What is an API Gateway?
What is an API Gateway?
 
ZgPHP 97 - Microservice architecture in Laravel
ZgPHP 97 - Microservice architecture in LaravelZgPHP 97 - Microservice architecture in Laravel
ZgPHP 97 - Microservice architecture in Laravel
 
Implementing SRE practices: SLI/SLO deep dive - David Blank-Edelman - DevOpsD...
Implementing SRE practices: SLI/SLO deep dive - David Blank-Edelman - DevOpsD...Implementing SRE practices: SLI/SLO deep dive - David Blank-Edelman - DevOpsD...
Implementing SRE practices: SLI/SLO deep dive - David Blank-Edelman - DevOpsD...
 
Hashicorp Corporate Pitch Deck Stenio_v2
Hashicorp Corporate Pitch Deck Stenio_v2 Hashicorp Corporate Pitch Deck Stenio_v2
Hashicorp Corporate Pitch Deck Stenio_v2
 
How Discord Migrated Trillions of Messages from Cassandra to ScyllaDB
How Discord Migrated Trillions of Messages from Cassandra to ScyllaDBHow Discord Migrated Trillions of Messages from Cassandra to ScyllaDB
How Discord Migrated Trillions of Messages from Cassandra to ScyllaDB
 
Running and Managing Mule Applications
Running and Managing Mule ApplicationsRunning and Managing Mule Applications
Running and Managing Mule Applications
 
WSO2 API Platform: Vision and Roadmap
WSO2 API Platform: Vision and RoadmapWSO2 API Platform: Vision and Roadmap
WSO2 API Platform: Vision and Roadmap
 
Building microservices with grpc
Building microservices with grpcBuilding microservices with grpc
Building microservices with grpc
 
What do you mean by “API as a Product”?
What do you mean by “API as a Product”?What do you mean by “API as a Product”?
What do you mean by “API as a Product”?
 

Viewers also liked

Node.js Event Emitter
Node.js Event EmitterNode.js Event Emitter
Node.js Event Emitter
Eyal Vardi
 
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
 
webMethods World: How Can You Innovate Even Faster With the Latest webMethods...
webMethods World: How Can You Innovate Even Faster With the Latest webMethods...webMethods World: How Can You Innovate Even Faster With the Latest webMethods...
webMethods World: How Can You Innovate Even Faster With the Latest webMethods...
Software AG
 
MQTT簡介與使用開放原始碼
MQTT簡介與使用開放原始碼MQTT簡介與使用開放原始碼
MQTT簡介與使用開放原始碼
Wei-Tsung Su
 
WebSocket MicroService vs. REST Microservice
WebSocket MicroService vs. REST MicroserviceWebSocket MicroService vs. REST Microservice
WebSocket MicroService vs. REST Microservice
Rick Hightower
 
Node.js Spplication Scaling
Node.js Spplication ScalingNode.js Spplication Scaling
Node.js Spplication Scaling
Eyal Vardi
 
Introduction to WAMP, a protocol enabling PUB/SUB and RPC over Websocket
Introduction to WAMP, a protocol enabling PUB/SUB and RPC over WebsocketIntroduction to WAMP, a protocol enabling PUB/SUB and RPC over Websocket
Introduction to WAMP, a protocol enabling PUB/SUB and RPC over Websocket
sametmax
 

Viewers also liked (7)

Node.js Event Emitter
Node.js Event EmitterNode.js Event Emitter
Node.js Event Emitter
 
WebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! FrameworkWebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! Framework
 
webMethods World: How Can You Innovate Even Faster With the Latest webMethods...
webMethods World: How Can You Innovate Even Faster With the Latest webMethods...webMethods World: How Can You Innovate Even Faster With the Latest webMethods...
webMethods World: How Can You Innovate Even Faster With the Latest webMethods...
 
MQTT簡介與使用開放原始碼
MQTT簡介與使用開放原始碼MQTT簡介與使用開放原始碼
MQTT簡介與使用開放原始碼
 
WebSocket MicroService vs. REST Microservice
WebSocket MicroService vs. REST MicroserviceWebSocket MicroService vs. REST Microservice
WebSocket MicroService vs. REST Microservice
 
Node.js Spplication Scaling
Node.js Spplication ScalingNode.js Spplication Scaling
Node.js Spplication Scaling
 
Introduction to WAMP, a protocol enabling PUB/SUB and RPC over Websocket
Introduction to WAMP, a protocol enabling PUB/SUB and RPC over WebsocketIntroduction to WAMP, a protocol enabling PUB/SUB and RPC over Websocket
Introduction to WAMP, a protocol enabling PUB/SUB and RPC over Websocket
 

Similar to API Design and WebSocket

The Web of Things
The Web of ThingsThe Web of Things
The Web of Things
Frank Greco
 
The Web of Things - IoTExpo SF - May 2014
The Web of Things - IoTExpo SF - May 2014The Web of Things - IoTExpo SF - May 2014
The Web of Things - IoTExpo SF - May 2014
Frank Greco
 
Past, Present and Future of WebSocket - HTML5DevConf May 2014
Past, Present and Future of WebSocket - HTML5DevConf May 2014Past, Present and Future of WebSocket - HTML5DevConf May 2014
Past, Present and Future of WebSocket - HTML5DevConf May 2014
Frank Greco
 
Web of Things (wiring web objects with Node-RED)
Web of Things (wiring web objects with Node-RED)Web of Things (wiring web objects with Node-RED)
Web of Things (wiring web objects with Node-RED)
Francesco Collova'
 
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
 
IoTaConf 2014 - IoT Connectivity, Standards, and Architecture
IoTaConf 2014 - IoT Connectivity, Standards, and ArchitectureIoTaConf 2014 - IoT Connectivity, Standards, and Architecture
IoTaConf 2014 - IoT Connectivity, Standards, and Architecture
Todd Montgomery
 
Ethernet base divice control
Ethernet base divice controlEthernet base divice control
Ethernet base divice control
Bhushan Deore
 
Javauserguide
JavauserguideJavauserguide
Javauserguidemuniinb4u
 
Internetandjava
InternetandjavaInternetandjava
Internetandjavamuniinb4u
 
Internetandjava
InternetandjavaInternetandjava
Internetandjavamuniinb4u
 
JavaInternetlearning
JavaInternetlearningJavaInternetlearning
JavaInternetlearningmuniinb4u
 
WebSocket Perspectives and Vision for the Future - HTML5DevConf Oct 2013 SF
WebSocket Perspectives and Vision for the Future - HTML5DevConf Oct 2013 SFWebSocket Perspectives and Vision for the Future - HTML5DevConf Oct 2013 SF
WebSocket Perspectives and Vision for the Future - HTML5DevConf Oct 2013 SF
Frank Greco
 
Web of Things - Connecting People and Objects on the Web
Web of Things - Connecting People and Objects on the WebWeb of Things - Connecting People and Objects on the Web
Web of Things - Connecting People and Objects on the Web
Dominique Guinard
 

Similar to API Design and WebSocket (20)

The Web of Things
The Web of ThingsThe Web of Things
The Web of Things
 
The Web of Things - IoTExpo SF - May 2014
The Web of Things - IoTExpo SF - May 2014The Web of Things - IoTExpo SF - May 2014
The Web of Things - IoTExpo SF - May 2014
 
Past, Present and Future of WebSocket - HTML5DevConf May 2014
Past, Present and Future of WebSocket - HTML5DevConf May 2014Past, Present and Future of WebSocket - HTML5DevConf May 2014
Past, Present and Future of WebSocket - HTML5DevConf May 2014
 
Web of Things (wiring web objects with Node-RED)
Web of Things (wiring web objects with Node-RED)Web of Things (wiring web objects with Node-RED)
Web of Things (wiring web objects with Node-RED)
 
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
 
IoTaConf 2014 - IoT Connectivity, Standards, and Architecture
IoTaConf 2014 - IoT Connectivity, Standards, and ArchitectureIoTaConf 2014 - IoT Connectivity, Standards, and Architecture
IoTaConf 2014 - IoT Connectivity, Standards, and Architecture
 
Ethernet base divice control
Ethernet base divice controlEthernet base divice control
Ethernet base divice control
 
Javauserguide
JavauserguideJavauserguide
Javauserguide
 
Internetandjava
InternetandjavaInternetandjava
Internetandjava
 
ppttips
ppttipsppttips
ppttips
 
ppttips
ppttipsppttips
ppttips
 
Internetandjava
InternetandjavaInternetandjava
Internetandjava
 
ppttips
ppttipsppttips
ppttips
 
Java
JavaJava
Java
 
ppttips
ppttipsppttips
ppttips
 
JavaInternetlearning
JavaInternetlearningJavaInternetlearning
JavaInternetlearning
 
ppt tips
ppt tipsppt tips
ppt tips
 
Cs2305 nol
Cs2305 nolCs2305 nol
Cs2305 nol
 
WebSocket Perspectives and Vision for the Future - HTML5DevConf Oct 2013 SF
WebSocket Perspectives and Vision for the Future - HTML5DevConf Oct 2013 SFWebSocket Perspectives and Vision for the Future - HTML5DevConf Oct 2013 SF
WebSocket Perspectives and Vision for the Future - HTML5DevConf Oct 2013 SF
 
Web of Things - Connecting People and Objects on the Web
Web of Things - Connecting People and Objects on the WebWeb of Things - Connecting People and Objects on the Web
Web of Things - Connecting People and Objects on the Web
 

Recently uploaded

LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Enhancing Performance with Globus and the Science DMZ
Enhancing Performance with Globus and the Science DMZEnhancing Performance with Globus and the Science DMZ
Enhancing Performance with Globus and the Science DMZ
Globus
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
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
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
Jen Stirrup
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
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
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
UiPathCommunity
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 

Recently uploaded (20)

LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Enhancing Performance with Globus and the Science DMZ
Enhancing Performance with Globus and the Science DMZEnhancing Performance with Globus and the Science DMZ
Enhancing Performance with Globus and the Science DMZ
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
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
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
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
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 

API Design and WebSocket

  • 1. API Design and WebSocket WoT Next? @frankgreco
  • 2. Background § Director of Technology @ Kaazing § Chairman NYJavaSIG (javasig.com) § Largest JUG in North America 8,000+ members § Financial Services, Architecture, Cloud § frank.greco@kaazing.com, @frankgreco
  • 3. A Primary Tenet of Computing History History If History Repeats Itself, Is There No Future?
  • 4. A Trip Down Memory Lane… In the beginning…
  • 5. Enterprise – “inside the firewall” (1980’s – early 90’s) tcp Client-Server
  • 6. Web – “over the firewall” (early 90’s – 2011) http tcp web server and/or app server app protocols Not efficient or effective for event-based systems…
  • 7. But Modern Applications are Dynamic and Event-based FX trading Monitoring Stock trading Utilities trading XaaS Logistics Notification Compliance Betting & bidding Voting In-store & online Collaboration
  • 8. Legacy Web u Designed for document transfer – HTTP ü Short-lived Request / Response interaction u Bidirectional, but half-duplex ü Traffic flows in only one direction at a time u Stateless ü Large amounts of metadata resent for each request The Web was not originally designed for “real-time”, event-based services…
  • 9. WebSocket – “TCP for the Web” u IETF Protocol and W3C JavaScript API for real-time, bi-directional, always-on connections u RFC 6455 – Dec 2011 u Easily add event-based data to web apps ü ws://mycompany.com/collaboration_svc ü wss://anothercompany.com/marketdata u Avoids polling u Avoids HTTP meta-data overhead u Shares port with HTTP (80/443) u Traverses Firewalls
  • 11. For Event-based Web Communication… Legacy HTTP vs WebSocket http:// ws:// u Application-level Socket over the Web u Supported by all Modern Browsers u Event-based Applications
  • 13. W3C WebSocket JavaScript API HTML5 WebSocket API But… Dealing with WebSocket is like dealing with TCP. It’s a streams-based model. You need to understand how to handle streams-based data over the wire. e.g., How do I do publish/subscribe?
  • 14. What is Missing? Where is the Application-level Protocol? Who handles retries? How do we handle publish/ subscribe semantics? How do we handle market data? How can we guarantee delivery? What do we do with slow consumers, last value cache, etc? What if the client is not currently active? What about partial data? How do I handle entitlements? ACL?
  • 15. Browser and Native Applications JMS XMPP AMQP B2B FTP VNC MQTT etc WebSocket TCP/IP Internet WebSocket Gateway WebSocket Gateway Protocol Layering is Possible WebSocket is a Transport layer
  • 16. Simplicity is a Useful Abstraction! Simplicity enables Innovation Complexity Innovation Higher Level APIs Reduce Complexity
  • 17. Higher Level APIs (over WebSocket) for JavaScript So if you can layer application protocols and APIs over WebSocket, what do you have? u Easier WebSocket programmability u Event-driven applications over the web u Event-driven APIs over the web u Not necessary to open non-standard ports u Web infrastructure now truly “disappears” u Reduction in complexity u Further opportunities to innovate u Mobile + cloud + HTML5/WebSocket u Internet of Things -> Web of Things u “Imagination is Everything”
  • 18. Publish/Subscribe Java Message Service (JMS) over WebSocket For Example…
  • 19. Java Message Service (JMS) u Java EE Message Oriented Middleware u JMS 1.0 2001, JMS 1.1 2002, JMS 2.0 2013 u Asynchronous Messaging vs. RPC u Loosely coupled vs. Tightly coupled u Pub/Sub, Topics, Queues u Transactions, Reliable
  • 20. Basic JMS conn = createConnection(); sess = conn.createSession(); topic = jndiContext.lookup(topic); pub = sess.createProducer(topic); pub.send(“hey Frank”); conn = createConnection(); sess = conn.createSession(); topic = jndiContext.lookup(topic); sub = sess.createConsumer(topic); sub.setMessageListener(this); … public void onMessage(Message m) { String s = m.getText(); … do stuff… } conn = createConnection(); sess = conn.createSession(); topic = jndiContext.lookup(topic); sub = sess.createConsumer(topic); sub.setMessageListener(this); … public void onMessage(Message m) { String s = m.getText(); … do stuff… } conn = createConnection(); sess = conn.createSession(); topic = jndiContext.lookup(topic); sub = sess.createConsumer(topic); sub.setMessageListener(this); … public void onMessage(Message m) { String s = m.getText(); … do stuff… } msg broker
  • 21. JMS Over the Web (JavaScript) Browser app - 100 msg/sec over port 80/443
  • 22. What WebSocket is Not u It is not a New AJAX AJAX was a lovable hack u It is not a Push mechanism WebSocket is full-duplex, bi-directional u It is not a Messaging system It’s an agnostic wire protocol It’s a low-level transport API u It is not a Replacement for HTTP HTTP is still great for static, cacheable info
  • 23. What’s next for WebSocket?
  • 24. Internet of Things (IoT) + Heterogeneity + Scale + Usability Futures
  • 25. The World is Naturally Event-based (“real-time”) Presentation Music Communication Logistics Big Data Risk Management Home Security Health Monitoring Intelligent Appliances Local Transportation Monitoring/ Management Remote control
  • 26.
  • 27. Let’s Take 1 Step Back to go 2 Steps Ahead… u Internet – Global system of interconnected networks that use IP to communicate u Internetworking – Connecting one network with another through a series of Gateways that provide a common method of communication
  • 28. The Web u A popular application service on the Internet u Based on TCP/IP u Advantages § Application deployment simplified – URI § Interoperable open standards and specifications § Ease of programmability – scripting § Global reach and Economy of scale § Accessed by ubiquitous Browsers and also non-Browsers u Two major protocols HTTP (1988/1999) and WebSocket (2007/2011)
  • 29. The Hidden Web – Most of the Web is Not Visible browsers APIs http://thumbs.dreamstime.com/x/iceberg-23503494.jpg
  • 30. Now… IoT, IIoT and M2M u A riff on “Ubiquitous Computing” (“Pervasive”) • Mark Weisner PARC 1988 u Its early so there’s different definitions • Similar to early days of Cloud Computing u M2M has been around for decades. • Primarily proprietary embedded systems and typically point-to-point (RPC) u IoT/IIoT (Industrial IoT) • Adds Internet connectivity • Networks of M2M systems connected via IP
  • 31. IoT/IIoT – Connectivity isn’t Sufficient u No formal API standards u Many protocol standards – interoperability low u No common, wide-reaching frameworks u No composition possibilities u Difficult to leverage economies of scale u Barrier to entry is high for millions of app developers u Also… we’re in a cloud, mobile, web api world
  • 32. u IoT – Internet of Things • Embedded computing endowed with Internet connectivity u WoT – Web of Things • Application and Services layer over IoT Developers! u Apply the benefits of the Web to IoT u WoT is a uniform interface to access IoT functionality u Provides the abstraction for control/monitoring (sensors/ actuators) u Accelerates innovation u Deployment, development, interoperability, economy of scale… IoT WoT Here’s Where the Web Comes In
  • 33. But Is HTTP the Right Choice? u Disadvantages of HTTP Request/Response u Lack of resiliency and robustness u Enterprise events retrieved by resource intensive polling techniques • Much bandwidth is wasted • Information can be delayed u Composite services brittle and lack transactionality u Enterprises learned advantages of ESB 10+ years ago u See failures of CORBA, Sun RPC, etc. u Clumsy AJAX/Comet workarounds to simulate real-time
  • 34. History Repeats Itself… RPC Asynchronous RPC Messaging REST Asynchronous REST Messaging ESB ISB? Enterprise Web/WoT • Can wait for response • Tight coupling • Centralized business processes • Vertical interaction • Easy to understand (xact) • Future response • Loose coupling • Independent business processes • More complexity (xact) Did I mention History repeats itself?...
  • 35. The Message is the Medium “…terse, self-classified messages, networking overhead isolated to a specialized tier of devices, and publish/subscribe relationships are the only way to fully distill the power of the coming Internet of Things” – Francis daCosta
  • 36. Typically an App Server and DB App Server is probably not the right architecture Data Flow – Human Web vs WoT Human Web WoT Large data to client Small data to server Do human-readable protocols make sense for non-humans?
  • 37. GW GW GW IoT/IIoT WoT WoT WoT Event Gateway Architecture
  • 38. Event Gateway Architecture – Future Directions GW GW GW GW GW GW Aggregator nodes GW • Scalability • Querying • Performance • Manageability • Composition • Circles of Trust • Event processing • CDN++
  • 39. Demos Click to Edit Master Title Style