SlideShare a Scribd company logo
1 of 27
Download to read offline
Poorna Chandra
Software Engineer, Cask
1
Near-real time event processing with guaranteed delivery
of HTTP callbacks
Webhooks
● Webhooks use case
● Implementation in CDAP
● Q&A
Overview
2
● Webhooks is a near-real time event delivery platform with guaranteed delivery
○ Subscribers generate events by engaging with messages
○ Deliver events to customers over HTTP within seconds
○ Customers react to events in near real time
What is Webhooks?
3
● A purchase receipt email fails to be delivered
● A mail bounce event is pushed to a service hosted by the retailer
● Retailer’s customer service is immediately aware of the failure
Example use cases
4
1. Process a stream of near real time events based on customer defined actions.
2. Guarantee delivery of processed events emitted to third party systems.
General problem statement
5
● High data integrity
○ Commerce, health, and finance messaging subject to government regulation
● Horizontal scalability
● Short time to market
○ Accessible developer experience
○ Existing Hadoop/YARN/HBase expertise and infrastructure
● Open Source
Primary concerns
6
● Some events need pieces of information from other event streams
○ Example: An email click needs the email send event for contextual information
● Wait until other events arrive to assemble the final event
● Join across streams
● Configurable TTL to wait to join (optional)
Implementation concern - Joins
7
● Configurable per customer endpoint
○ Retry
○ Throttle
○ TTL to deliver (optional)
● Reporting metrics, SLA compliance
Implementation concern - Delivery guarantees
8
High level architecture
Ingest
Join
Route
Store
HTTP POST
Kafka
Source
External
System
9
public class EventRouter {
private Map<EventType, Route> routesMap;
public void process(Event e) {
Route route = routesMap.get(e.clientId());
if (null != route) {
httpPost(e, route);
}
}
}
Business logic
10
public class EventJoiner {
private Map<JoinKey, SendEvent> sends;
public void process(ResponseEvent e) {
SendEvent send = sends.get(e.getKey());
if (null != send) {
Event joined = join(send, e);
routeEvent(joined);
}
}
}
Business logic
11
● Scaling data store is easy - use HBase
● Scaling application involves
○ Transactions
○ Application stack
○ Lifecycle management
○ Data movement
○ Coordination
How to scale?
12
13
● An open source framework to build and deploy data applications on
Apache™ Hadoop®
● Provides abstractions to represent data access and processing
pipelines
● Framework level guarantees for exactly-once semantics
● Transaction support on HBase
● Supports real time and batch processing
● Built on YARN and HBase
Cask Data Application Platform (CDAP)
14
Webhooks in CDAP
15
Business logic
public class EventJoiner {
private Map<JoinKey, SendEvent> sends;
public void process(ResponseEvent e) {
SendEvent send = sends.get(e.getKey());
if (null != send) {
Event joined = join(send, e);
routeEvent(joined);
}
}
}
16
Business logic in CDAP - Flowlet
public class EventJoiner extends AbstractFlowlet {
@UseDataSet(“sends”)
private SendEventDataset sends;
private OutputEmitter<Event> outQueue;
@ProcessInput
public void join(ResponseEvent e) {
SendEvent send = sends.get(e.getKey());
if (send != null) {
Event joined = join(e, send);
outQueue.emit(joined);
}
}
}
17
public class EventJoiner extends AbstractFlowlet {
@UseDataSet(“sends”)
private SendEventDataset sends;
private OutputEmitter<Event> outQueue;
@ProcessInput
public void join(ResponseEvent e) {
SendEvent send = sends.get(e.getKey());
if (send != null) {
Event joined = join(e, send);
outQueue.emit(joined);
}
}
}
Access data with Datasets
18
Chain Flowlets with Queues
public class EventJoiner extends AbstractFlowlet {
@UseDataSet(“sends”)
private SendEventDataset sends;
private OutputEmitter<Event> outQueue;
@ProcessInput
public void join(ResponseEvent e) {
SendEvent send = sends.get(e.getKey());
if (send != null) {
Event joined = join(e, send);
outQueue.emit(joined);
}
}
}
19
Tigon Flow
Event Joiner
Flowlet
HBase Queue HBase Queue
Start Tx End Tx
Start Tx
End Tx
Event Router
Flowlet
● Real time streaming processor
● Composed of Flowlets
● Exactly-once semantics
HBase Queue
20
Scaling Flowlets
Event Joiner
Flowlets
Event Router
Flowlets
HBase Queue
YARN
Containers
FIFO
Round Robin
Hash Partitioning
21
Summary
● CDAP makes development easier by handling the overhead of
scalability
○ Transactions
○ Application stack
○ Lifecycle management
○ Data movement
○ Coordination
22
Datasets and Tephra
23
Data abstraction using Dataset
● Store and retrieve data
● Reusable data access patterns
● Abstraction of underlying data storage
○ HBase
○ LevelDB
○ In-memory
● Can be shared between Flows (real-time) and MapReduce (batch)
24
● Transactions make exactly-once semantics possible
● Multi-row and across HBase regions transactions
● Optimistic concurrency control (Omid style)
● Open source (Apache 2.0 License)
● http://tephra.io
Transaction support with Tephra
25
● Used today in enterprise cloud applications
● CDAP is open source (Apache 2.0 License)
Use and contribute
http://cdap.io/
26
Q&A
Poorna Chandra
poorna@cask.co
http://cdap.io
27

More Related Content

More from Cask Data

More from Cask Data (6)

ACID Transactions in Apache Phoenix with Apache Tephra™ (incubating), by Poor...
ACID Transactions in Apache Phoenix with Apache Tephra™ (incubating), by Poor...ACID Transactions in Apache Phoenix with Apache Tephra™ (incubating), by Poor...
ACID Transactions in Apache Phoenix with Apache Tephra™ (incubating), by Poor...
 
Logging infrastructure for Microservices using StreamSets Data Collector
Logging infrastructure for Microservices using StreamSets Data CollectorLogging infrastructure for Microservices using StreamSets Data Collector
Logging infrastructure for Microservices using StreamSets Data Collector
 
Introducing Athena: 08/19 Big Data Application Meetup, Talk #3
Introducing Athena: 08/19 Big Data Application Meetup, Talk #3 Introducing Athena: 08/19 Big Data Application Meetup, Talk #3
Introducing Athena: 08/19 Big Data Application Meetup, Talk #3
 
NRT Event Processing with Guaranteed Delivery of HTTP Callbacks, HBaseCon 2015
NRT Event Processing with Guaranteed Delivery of HTTP Callbacks, HBaseCon 2015NRT Event Processing with Guaranteed Delivery of HTTP Callbacks, HBaseCon 2015
NRT Event Processing with Guaranteed Delivery of HTTP Callbacks, HBaseCon 2015
 
Brown Bag : CDAP (f.k.a Reactor) Streams Deep DiveStream on file brown bag
Brown Bag : CDAP (f.k.a Reactor) Streams Deep DiveStream on file brown bagBrown Bag : CDAP (f.k.a Reactor) Streams Deep DiveStream on file brown bag
Brown Bag : CDAP (f.k.a Reactor) Streams Deep DiveStream on file brown bag
 
HBase Meetup @ Cask HQ 09/25
HBase Meetup @ Cask HQ 09/25HBase Meetup @ Cask HQ 09/25
HBase Meetup @ Cask HQ 09/25
 

Recently uploaded

%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 

Recently uploaded (20)

%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 

06/23 Big Data Application Meetup, Talk #3: Webhooks: NRT event processing with guaranteed delivery

  • 1. Poorna Chandra Software Engineer, Cask 1 Near-real time event processing with guaranteed delivery of HTTP callbacks Webhooks
  • 2. ● Webhooks use case ● Implementation in CDAP ● Q&A Overview 2
  • 3. ● Webhooks is a near-real time event delivery platform with guaranteed delivery ○ Subscribers generate events by engaging with messages ○ Deliver events to customers over HTTP within seconds ○ Customers react to events in near real time What is Webhooks? 3
  • 4. ● A purchase receipt email fails to be delivered ● A mail bounce event is pushed to a service hosted by the retailer ● Retailer’s customer service is immediately aware of the failure Example use cases 4
  • 5. 1. Process a stream of near real time events based on customer defined actions. 2. Guarantee delivery of processed events emitted to third party systems. General problem statement 5
  • 6. ● High data integrity ○ Commerce, health, and finance messaging subject to government regulation ● Horizontal scalability ● Short time to market ○ Accessible developer experience ○ Existing Hadoop/YARN/HBase expertise and infrastructure ● Open Source Primary concerns 6
  • 7. ● Some events need pieces of information from other event streams ○ Example: An email click needs the email send event for contextual information ● Wait until other events arrive to assemble the final event ● Join across streams ● Configurable TTL to wait to join (optional) Implementation concern - Joins 7
  • 8. ● Configurable per customer endpoint ○ Retry ○ Throttle ○ TTL to deliver (optional) ● Reporting metrics, SLA compliance Implementation concern - Delivery guarantees 8
  • 9. High level architecture Ingest Join Route Store HTTP POST Kafka Source External System 9
  • 10. public class EventRouter { private Map<EventType, Route> routesMap; public void process(Event e) { Route route = routesMap.get(e.clientId()); if (null != route) { httpPost(e, route); } } } Business logic 10
  • 11. public class EventJoiner { private Map<JoinKey, SendEvent> sends; public void process(ResponseEvent e) { SendEvent send = sends.get(e.getKey()); if (null != send) { Event joined = join(send, e); routeEvent(joined); } } } Business logic 11
  • 12. ● Scaling data store is easy - use HBase ● Scaling application involves ○ Transactions ○ Application stack ○ Lifecycle management ○ Data movement ○ Coordination How to scale? 12
  • 13. 13
  • 14. ● An open source framework to build and deploy data applications on Apache™ Hadoop® ● Provides abstractions to represent data access and processing pipelines ● Framework level guarantees for exactly-once semantics ● Transaction support on HBase ● Supports real time and batch processing ● Built on YARN and HBase Cask Data Application Platform (CDAP) 14
  • 16. Business logic public class EventJoiner { private Map<JoinKey, SendEvent> sends; public void process(ResponseEvent e) { SendEvent send = sends.get(e.getKey()); if (null != send) { Event joined = join(send, e); routeEvent(joined); } } } 16
  • 17. Business logic in CDAP - Flowlet public class EventJoiner extends AbstractFlowlet { @UseDataSet(“sends”) private SendEventDataset sends; private OutputEmitter<Event> outQueue; @ProcessInput public void join(ResponseEvent e) { SendEvent send = sends.get(e.getKey()); if (send != null) { Event joined = join(e, send); outQueue.emit(joined); } } } 17
  • 18. public class EventJoiner extends AbstractFlowlet { @UseDataSet(“sends”) private SendEventDataset sends; private OutputEmitter<Event> outQueue; @ProcessInput public void join(ResponseEvent e) { SendEvent send = sends.get(e.getKey()); if (send != null) { Event joined = join(e, send); outQueue.emit(joined); } } } Access data with Datasets 18
  • 19. Chain Flowlets with Queues public class EventJoiner extends AbstractFlowlet { @UseDataSet(“sends”) private SendEventDataset sends; private OutputEmitter<Event> outQueue; @ProcessInput public void join(ResponseEvent e) { SendEvent send = sends.get(e.getKey()); if (send != null) { Event joined = join(e, send); outQueue.emit(joined); } } } 19
  • 20. Tigon Flow Event Joiner Flowlet HBase Queue HBase Queue Start Tx End Tx Start Tx End Tx Event Router Flowlet ● Real time streaming processor ● Composed of Flowlets ● Exactly-once semantics HBase Queue 20
  • 21. Scaling Flowlets Event Joiner Flowlets Event Router Flowlets HBase Queue YARN Containers FIFO Round Robin Hash Partitioning 21
  • 22. Summary ● CDAP makes development easier by handling the overhead of scalability ○ Transactions ○ Application stack ○ Lifecycle management ○ Data movement ○ Coordination 22
  • 24. Data abstraction using Dataset ● Store and retrieve data ● Reusable data access patterns ● Abstraction of underlying data storage ○ HBase ○ LevelDB ○ In-memory ● Can be shared between Flows (real-time) and MapReduce (batch) 24
  • 25. ● Transactions make exactly-once semantics possible ● Multi-row and across HBase regions transactions ● Optimistic concurrency control (Omid style) ● Open source (Apache 2.0 License) ● http://tephra.io Transaction support with Tephra 25
  • 26. ● Used today in enterprise cloud applications ● CDAP is open source (Apache 2.0 License) Use and contribute http://cdap.io/ 26