SMART APPLICATIONS PLATFORM
—
WebHooks vs WebSub
which one to stream your events in
Real Time?
Audrey Neveu - @Audrey_Neveu
ABOUT ME
Full Stack Developer Co-Leader France
@Audrey_Neveu
REAL-TIME IS THE NEW NORM
F.O.M.O (FEAR OF MISSING OUT)
DATA IS IMPORTANT, AND SO ARE EVENTS
BUT EVENTS… A/ ARE UNPREDICTABLEA/ ARE UNPREDICTABLE
BUT EVENTS… A/ ARE UNPREDICTABLEA/ ARE UNPREDICTABLE
B/ HAVE DIFFERENT USAGES
Polling
POLLING
98.5% of polls are
wasted
Source:
http://resthooks.org/
POLLING MADNESS ™
98.5% of polls are
wasted
Source:
http://resthooks.org/
POLLING MADNESS ™
WebHooks
● webhooks.org
● aka User Defined HTTP Callback
● concept / method
●
WEBHOOKS
Consumer
HTTP/1.1 201 Created
Link:<http://subscription-serve
r.com/subscription>;
rel="subscription"
POST /eventsource HTTP/1.1
Host: subscription-server.com
Pragma: subscribe
Callback:
<http://example.com/callback>;
method="POST"
rel="subscriber"
API Provider
POST /callback HTTP/1.1
Host: example.com
Link:
<http://subscription-server.com
/subscription>;
rel="subscription"
Content-HMAC: sha1
C+7Hteo/D9vJXQ3UfzxbwnXaijM=
Content-Length: 21
Content-Type:
application/x-www-form-urlencod
ed
payload=Hello%20world
WEBHOOKS
✓ Define a callback URL ✓ Create a subscription endpoint
- GET /webhook
- POST /webhook
- GET /webhook/{id}
- PUT /webhook/{id}
- DELETE /webhook/{id}
Consumer API Provider
WEBHOOKS
✓ Define a callback URL
Consumer API Provider
✓ Implement your webhook queue
- inline HTTP Requests
- SQL-based queue
- AMQP broker
- batch
WEBHOOKS
CONSUMER SETUP EXAMPLE
EVENT RECEIVED
POST /callback HTTP/1.1
Host: www.example.com
X-Github-Delivery:
72d3162e-cc78-11e3-81ab-4c9367
dc0958
User-Agent:
GitHub-Hookshot/044aadd
Content-Type: application/json
Content-Length: 6615
X-GitHub-Event: issues
Payload=
{
"action": "opened",
"issue": {
"url": "https://api.github.com/repos/octocat/Hello-World/issues/1347",
"number": 1347,
...
},
"repository" : {
"id": 1296269,
"full_name": "octocat/Hello-World",
"owner": {
"login": "octocat",
"id": 1,
...
},
...
},
"sender": {
"login": "octocat",
"id": 1,
...
}
}
PROS AND CONS
✓ Easily consumed
✓ Without dedicated resources
■ Poor user experience
■ Does not work with all clients
■ Manual setup✓ Easily integrated
■ Debugging
✓ (almost) Real-Time updates
KNOWN ISSUES
Consumer API Provider
■ DDoS Attack
■ Missed notification
■ DDoS Attack
■ Deduplication
CHECK LIST
Consumer API Provider
✓ Implement authentication
✓ Expected answer?
✓ Monitor payload size
✓ Handle request number
✓ Handle duplicates
✓ One callback per webhook
WebSub
✓ RSS / Atom feeds
✓ pubsubhubbub/ & w3c.github.io/websub
✓ Open Protocol
✓ Based on Publish / Subscribe Pattern and on topics
✓ Formerly known as PubSubHubbub, PubSub, Push...
WEBSUB
✓ W3C proposed recommandation since April 2017
Publishers SubscribersHub
WEBSUB
DiscoveryPublishers
Link: <https://my-hub.com/>; rel="hub"
Link: <https://my.resource.com>; rel="self"
<link rel="self" href="https://my-resource.com/">
<link rel="hub" href="https://my-hub.com/">
SUBSCRIBE - PUBLISHERS
Subscribers Send subscription request to the Hub
POST https://my-hub.com/
…
hub.mode="subscribe"
hub.topic="https://my-resource.com/"
hub.callback="http://example.com/callback"
SUBSCRIBE - SUBSCRIBERS 1/2
hub.secret="my-token"
Hub Verify intent of the subscribers
GET http://example.com/callback
…
hub.mode="subscribe"
hub.topic="https://my-resource.com/"
hub.challenge="a random string"
SUBSCRIBE - HUB
Subscribers
HTTP/1.1 200 OK
Body:{
hub.challenge: "a random string"
}
Answer verification request
SUBSCRIBE - SUBSCRIBERS 2/2
CONSUMER SETUP
Publishers Ping the Hub
POST https://my-hub.com/
…
hub.mode=publish
hub.url=https://my.updated-resource.com
PUBLISH - PUBLISHERS
Hub
POST http://example.com/callback
Link: <https://my-hub.com/>; rel="hub"
Link: <https://my.updated-resource.com>; rel="self"
Content Distribution
PUBLISH - HUB
Subscribers Pull the updated resource
GET https://my.updated-resource.com
PUBLISH - SUBSCRIBERS
{
"object":"page",
"entry":[
{
"id":"51044240199134611",
"time":1447342027,
"changes":[
{
"field":"leadgen",
"value":{
"adgroup_id":0,
"ad_id":0,
"created_time":1447342026,
"leadgen_id":55459717045641545,
"page_id":516540199134611,
"form_id":551111744595541
}
}
]
}
]
}
EVENT RECEIVED
Subscribers Send unsubscription request to the Hub
POST https://my-hub.com/
…
hub.mode="unsubscribe"
hub.topic="https://my-resource.com/"
hub.callback="http://example.com/callback"
UNSUBSCRIBE - SUBSCRIBERS 1/2
Hub Verify intent of the subscribers
GET http://example.com/callback
…
hub.mode="unsubscribe"
hub.topic="https://my-resource.com/"
hub.challenge="a random string"
UNSUBSCRIBE - HUB
Subscribers Answer verification request
HTTP/1.1 200 OK
Body:{
hub.challenge: "a random string"
}
UNSUBSCRIBE - SUBSCRIBERS 2/2
PROS AND CONS
✓ Easily consumed
✓ Without dedicated resources
■ Poor user experience
■ Does not work with all clients
■ Manual setup✓ Easily integrated
■ Debugging
✓ (almost) Real-Time updates
■ Manual setup
PROS AND CONS
✓ Easily consumed
✓ Without dedicated resources
■ Does not work with all clients
✓ Easily integrated
■ Debugging
✓ (almost) Real-Time updates ■ Need another call to get data
KNOWN ISSUES
■ DDoS Attack
■ Missed notification
■ DDoS Attack
■ Deduplication
Consumer API Provider
■ DDoS Attack ■ DDoS Attack
Prenez de la hauteur avec SaagieDEMO
CONCLUSION
Prenez de la hauteur avec SaagieTHANKS!

More Related Content

PDF
Rustam Aliyev and Ivan Martynov - From monolith web app to micro-frontends – ...
PDF
Micro frontend: The microservices puzzle extended to frontend
PPTX
Big Data Workshop
PPTX
Best Practices for Architecting a Pragmatic Web API.
PPTX
Hackazon realistic e-commerce Hack platform
PDF
Reactive Java Microservices with Spring Boot and JHipster - Denver JUG 2021
PDF
Amp your site an intro to accelerated mobile pages
PDF
Primefaces mobile users_guide_0_9
Rustam Aliyev and Ivan Martynov - From monolith web app to micro-frontends – ...
Micro frontend: The microservices puzzle extended to frontend
Big Data Workshop
Best Practices for Architecting a Pragmatic Web API.
Hackazon realistic e-commerce Hack platform
Reactive Java Microservices with Spring Boot and JHipster - Denver JUG 2021
Amp your site an intro to accelerated mobile pages
Primefaces mobile users_guide_0_9

What's hot (20)

PPTX
CQ Provisionning & Authoring
PDF
Progressive web apps
PPTX
Web application framework
PDF
Building Progressive Web Apps for Android and iOS
PDF
Angular vs React for Web Application Development
PDF
Microservices with Spring Boot
PDF
Java Web Application Security - Utah JUG 2011
PDF
Java REST API Comparison: Micronaut, Quarkus, and Spring Boot - jconf.dev 2020
PPTX
Plugins unplugged
PDF
Ten Battle-Tested Tips for Atlassian Connect Add-ons
PPTX
Chanhao Jiang And David Wei Presentation Quickling Pagecache
PDF
Front End Development for Back End Java Developers - Jfokus 2020
PPTX
Instant Security & Scalable User Management with Spring Boot
KEY
Eclipse IAM, Maven Integration For Eclipse
PPTX
Progressive Web Apps 101
PPT
Useful Rails Plugins
PDF
Progressive Web Apps
PPT
Q4E and Eclipse IAM, Maven integration for Eclipse
PDF
Introducing Firebase by Google
PDF
Spring Boot APIs and Angular Apps: Get Hip with JHipster! KCDC 2019
CQ Provisionning & Authoring
Progressive web apps
Web application framework
Building Progressive Web Apps for Android and iOS
Angular vs React for Web Application Development
Microservices with Spring Boot
Java Web Application Security - Utah JUG 2011
Java REST API Comparison: Micronaut, Quarkus, and Spring Boot - jconf.dev 2020
Plugins unplugged
Ten Battle-Tested Tips for Atlassian Connect Add-ons
Chanhao Jiang And David Wei Presentation Quickling Pagecache
Front End Development for Back End Java Developers - Jfokus 2020
Instant Security & Scalable User Management with Spring Boot
Eclipse IAM, Maven Integration For Eclipse
Progressive Web Apps 101
Useful Rails Plugins
Progressive Web Apps
Q4E and Eclipse IAM, Maven integration for Eclipse
Introducing Firebase by Google
Spring Boot APIs and Angular Apps: Get Hip with JHipster! KCDC 2019
Ad

Similar to WEBHOOKS VS WEBSUB - COMMENT STREAMER VOS ÉVÉNEMENTS EN TEMPS RÉEL ? (20)

PDF
Building Real-time Systems with WebSub - Ballerina Community Call - 11/30/2021
PPTX
The end of polling : why and how to transform a REST API into a Data Streamin...
PPTX
Updated Pubsubhubbub flow presentation.pptx
PPT
Updated Pubsubhubbub Flow Presentation
PPTX
Webhook
ODP
The real-time web
PDF
WebHooks in 10 Minutes
PDF
Realtime Content Delivery: Powering dynamic instant experiences
PDF
Information sharing pipeline
PPTX
Hookbox
PDF
Webhooks in Microsoft SharePoint Online
PDF
Real time web apps
PDF
Le Streaming d'API : pourquoi et comment transformer vos APIs statiques en do...
PDF
[WSO2 API Manager Community Call: Streaming API Support in WSO2 API Manager 4.0
PDF
fajfkljflafjflkflkajflajflkfkjaslfkfljjaf
KEY
Exploring Google's Social APIs
PDF
Realtime Streaming using Autobahn Websockets
PDF
APIdays Paris 2018 - Deliver API Updates in Real Time with Mercure.rocks Kévi...
PDF
Backend & Frontend architecture scalability & websockets
PPTX
Real-Time Web APIs
Building Real-time Systems with WebSub - Ballerina Community Call - 11/30/2021
The end of polling : why and how to transform a REST API into a Data Streamin...
Updated Pubsubhubbub flow presentation.pptx
Updated Pubsubhubbub Flow Presentation
Webhook
The real-time web
WebHooks in 10 Minutes
Realtime Content Delivery: Powering dynamic instant experiences
Information sharing pipeline
Hookbox
Webhooks in Microsoft SharePoint Online
Real time web apps
Le Streaming d'API : pourquoi et comment transformer vos APIs statiques en do...
[WSO2 API Manager Community Call: Streaming API Support in WSO2 API Manager 4.0
fajfkljflafjflkflkajflajflkfkjaslfkfljjaf
Exploring Google's Social APIs
Realtime Streaming using Autobahn Websockets
APIdays Paris 2018 - Deliver API Updates in Real Time with Mercure.rocks Kévi...
Backend & Frontend architecture scalability & websockets
Real-Time Web APIs
Ad

Recently uploaded (20)

PDF
Soil Improvement Techniques Note - Rabbi
PDF
SMART SIGNAL TIMING FOR URBAN INTERSECTIONS USING REAL-TIME VEHICLE DETECTI...
PPTX
AUTOMOTIVE ENGINE MANAGEMENT (MECHATRONICS).pptx
PDF
III.4.1.2_The_Space_Environment.p pdffdf
PPTX
Feature types and data preprocessing steps
PDF
Abrasive, erosive and cavitation wear.pdf
PDF
Exploratory_Data_Analysis_Fundamentals.pdf
PPTX
Management Information system : MIS-e-Business Systems.pptx
PDF
737-MAX_SRG.pdf student reference guides
PPTX
Module 8- Technological and Communication Skills.pptx
PPTX
CURRICULAM DESIGN engineering FOR CSE 2025.pptx
PPTX
Sorting and Hashing in Data Structures with Algorithms, Techniques, Implement...
PPTX
Fundamentals of Mechanical Engineering.pptx
PDF
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
PPTX
Current and future trends in Computer Vision.pptx
PDF
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
PPT
Total quality management ppt for engineering students
PDF
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
PDF
UNIT no 1 INTRODUCTION TO DBMS NOTES.pdf
PPTX
Fundamentals of safety and accident prevention -final (1).pptx
Soil Improvement Techniques Note - Rabbi
SMART SIGNAL TIMING FOR URBAN INTERSECTIONS USING REAL-TIME VEHICLE DETECTI...
AUTOMOTIVE ENGINE MANAGEMENT (MECHATRONICS).pptx
III.4.1.2_The_Space_Environment.p pdffdf
Feature types and data preprocessing steps
Abrasive, erosive and cavitation wear.pdf
Exploratory_Data_Analysis_Fundamentals.pdf
Management Information system : MIS-e-Business Systems.pptx
737-MAX_SRG.pdf student reference guides
Module 8- Technological and Communication Skills.pptx
CURRICULAM DESIGN engineering FOR CSE 2025.pptx
Sorting and Hashing in Data Structures with Algorithms, Techniques, Implement...
Fundamentals of Mechanical Engineering.pptx
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
Current and future trends in Computer Vision.pptx
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
Total quality management ppt for engineering students
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
UNIT no 1 INTRODUCTION TO DBMS NOTES.pdf
Fundamentals of safety and accident prevention -final (1).pptx

WEBHOOKS VS WEBSUB - COMMENT STREAMER VOS ÉVÉNEMENTS EN TEMPS RÉEL ?