SlideShare a Scribd company logo
Parallel Complex Event Processing

Karol Grzegorczyk
03-06-2013
Big Data classification

[http://en.wikipedia.org/wiki/File:3_states_of_data.jpg]
Event-driven architecture
Complex Event Processing solutions
●

Open Source:
–
–

Drools Fusion

–

Storm

–
●

Esper

WSO2 Complex Event Processor

Proprietary software
–

Oracle Complex Event Processing

–

StreamBase Complex Event Processing

–

Informatica RulePoint

–

TIBCO Complex Event Processing
Esper
●

Two editions:
―

Open source library

―

Enterprise server based on Jetty

●

Core component of Esper is a CEP engine.

●

CEP engine is working like database turned upside-down

●

Expressions are defined in Event Processing Language (EPL)
―

Declarative domain specific language

―

Similar with the SQL query language but differs from SQL in its use of views
rather than tables and events instead of records (rows)

―

Views are reused among EPL statements for efficiency!

select * from OrderEvent.win:length(5)
Streams
●

Complex event can be build based on several data streams.
select * from AlertEvent as a, NewsEvent as n
where a.symbol = n.symbol

●

Esper defines two types of data streams:
―

Filter-based event stream
select * from OrderEvent(itemType='shirt')

―

Pattern-based event stream
select * from pattern [
OrderEvent(itemType='shirt') -> OrderEvent(itemType='trousers')]

●

It is possible to join between filter-based and pattern-based streams!

●

Events can be forwarded to others streams using INSERT INTO keywords.

●

It is also possible to update event (using UPDATE keyword) before it applies
to any selecting statements
Views
●

●

●

Events are derived from streams (both filter- and
pattern-based) by views
Default view encloses all events from the stream
since addition of the statement to the engine.
View types:
–

Data windows (e.g. lenght, time)

–

Named windows

–

Extension Views (sorted window, rankied window,
time-order view)

–

Standard views (unique, grouped, size, lastevent)

–

Statistics view (univariate, regression, correlation)
Esper processing

●

●

●

Update listeners and subscriber objects are associated with EPL
statements
By defualt listeners and subscribers are notified when new event that
match EPL query arrive (insert stream)
In addition listeners and subscribers can be notified when some event
that match EPL query is removed from the stream (due to the limit of
particular window)
[Esper Reference]
Filtering

Esper provides two types of filtering:
●

Stream-level filtering
select * from OrderEvent(type= 'shirt')

●

Post-data-window filtering
select * from OrderEvent where type = 'shirt'
[Esper Reference]
[Esper Reference]
Stream-level filtering vs post-data-window filtering

select * from OrderEvent(type= 'shirt')

vs
select * from OrderEvent where type = 'shirt'

The first form is preferred, but still sometimes post-data-window filtering is
desired:
Select one hundred orders and calculate average price of trousers.
select avg(price) from OrderEvent.win:length(100)
where type = 'trousers'
Data Windows
●

Basic windows:
―

―

Length batch window (win:length_batch)

―

Time window (win:time)

―

●

Length window (win:length)

Time batch window (win:time_batch)

Advanced time windows
―

Externally-timed window (win:ext_timed)

―

Externally-timed batch window (win:ext_timed_batch)

―

Time-Length combination batch window (win:time_length_batch)

―

Time-Accumulating window (win:time_accum)

―

Keep-All window (win:keepall)

―

First Length (win:firstlength)

―

First Time (win:firsttime)
[Esper Reference]
[Esper Reference]
Scaling Esper

●

●

According to the documentation Esper exceeds over 500 000 event/s on
a dual CPU 2GHz Intel based hardware, with engine latency below 3
microseconds average (below 10us with more than 99% predictability) on
a VWAP benchmark with 1000 statements registered in the system - this
tops at 70 Mbit/s at 85% CPU usage.
Parallel processing
–

Within one machine
-

–

Context partitions

With multiple machines
-

Partitioned stream

-

Partition by use case
Context
●

Context partition – basic level for locking

●

By default single context partition

●

Context types:
―
―

Hash Segmented

―

Category Segmented

―

Non-overlapping context

―

●

Keyed Segmented

Overlapping context

Nesting context
Keyed Segmented Context

create context ByCustomerAndAccount
partition by custId and account from BankTxn
context ByCustomerAndAccount
select custId, account, sum(amount) from BankTxn
Implicite grouping in select statement.
Hash Segmented Context

Assigns events to context partitions based on result of a hash function and modulo
operation
create context SegmentedByCustomerHash coalesce by hash_code (custId) from
BankTxn granularity 16 preallocate
context SegmentedByCustomerHash
select custId, account, sum(amount) from BankTxn group by custId, account

No implicite grouping in select statement!
Category Segmented Context

Assigns events to context partitions based on the values of one or more event
properties, using a predicate expression(s) to define context partition membership.
create context CategoryByTemp
group temp < 65 as cold,
group temp between 65 and 85 as normal,
group temp > 85 as large
from SensorEvent
context CategoryByTemp
select context.label, count(*) from SensorEvent
Non-overlapping context

Non-overlapping context is created when start condition is meet and ended when end
condition is meet. There is always either one or zero context partions.
create context NineToFive start (0, 9, *, *, *) end (0, 17, *, *, *)
context NineToFive select * from TrafficEvent(speed >= 100)
Overlapping context

This context initiates a new context partition when an initiating condition occurs, and
terminates one or more context partitions when the terminating condition occurs.
create context CtxTrainEnter initiated by TrainEnterEvent as te
terminated after 5 minutes
context CtxTrainEnter select t1 from pattern [t1=TrainEnterEvent ->
timer:interval(5 min) and not TrainLeaveEvent(trainId =
context.te.trainId)]
Context nesting

In case of nested contextx the context declared first controls the
lifecycle of the context(s) declared thereafter.
create context NineToFiveSegmented
context NineToFive start (0, 9, *, *, *) end (0, 17, *, *, *),
context SegmentedByCustomer partition by custId from BankTxn
context NineToFiveSegmented
select custId, account, sum(amount) from BankTxn group by account
Partitioning without context declaration

Grouped data window std:groupwin()
What is the difference between:
select avg(price) from OrderEvent.std:groupwin(itemType).win:length(10)

And
select avg(price) from OrderEvent.win:length(10) group by itemType

?
Parallel processing on multiple machines

Partitioned stream
● Partition by use case
●
[Esper Enterprise Edition Reference]
Thank you

More Related Content

Viewers also liked (20)

PPTX
Analyzing the CDS market using CGP
Karol Grzegorczyk
 
PPT
Standards Based Approach to User Interface Development
Sameer Chavan
 
PDF
WSO2 Product Release Webinar: WSO2 Complex Event Processor 4.0
WSO2
 
PDF
Complex Event Processor 3.0.0 - An overview of upcoming features
WSO2
 
PDF
WSO2 Complex Event Processor
Sriskandarajah Suhothayan
 
PPT
Complex Event Processing
Matthew Versaggi
 
PDF
UML, OWL and REA based enterprise business model 20110201a
Richard Kuo
 
PDF
Applying CEP Drools Fusion - Drools jBPM Bootcamps 2011
Geoffrey De Smet
 
PPTX
Patterns and practices for real-world event-driven microservices
Rachel Reese
 
PPTX
C* Summit 2013: Eventual Consistency != Hopeful Consistency by Christos Kalan...
DataStax Academy
 
PDF
09 semantic web & ontologies
Marina Santini
 
PPT
Event Driven Architecture (EDA), November 2, 2006
Tim Bass
 
PPT
Aaai 2011 event processing tutorial
Opher Etzion
 
PDF
Common ddd pitfalls
Tom Janssens
 
PDF
DataStax: Rigorous Cassandra Data Modeling for the Relational Data Architect
DataStax Academy
 
PDF
Esper - CEP Engine
Aparna Chaudhary
 
PDF
Event Driven Architecture
Lourens Naudé
 
PPTX
Real World Event Sourcing and CQRS
Matthew Hawkins
 
PDF
From legacy to DDD
Andrzej Krzywda
 
PPTX
Siddhi: A Second Look at Complex Event Processing Implementations
Srinath Perera
 
Analyzing the CDS market using CGP
Karol Grzegorczyk
 
Standards Based Approach to User Interface Development
Sameer Chavan
 
WSO2 Product Release Webinar: WSO2 Complex Event Processor 4.0
WSO2
 
Complex Event Processor 3.0.0 - An overview of upcoming features
WSO2
 
WSO2 Complex Event Processor
Sriskandarajah Suhothayan
 
Complex Event Processing
Matthew Versaggi
 
UML, OWL and REA based enterprise business model 20110201a
Richard Kuo
 
Applying CEP Drools Fusion - Drools jBPM Bootcamps 2011
Geoffrey De Smet
 
Patterns and practices for real-world event-driven microservices
Rachel Reese
 
C* Summit 2013: Eventual Consistency != Hopeful Consistency by Christos Kalan...
DataStax Academy
 
09 semantic web & ontologies
Marina Santini
 
Event Driven Architecture (EDA), November 2, 2006
Tim Bass
 
Aaai 2011 event processing tutorial
Opher Etzion
 
Common ddd pitfalls
Tom Janssens
 
DataStax: Rigorous Cassandra Data Modeling for the Relational Data Architect
DataStax Academy
 
Esper - CEP Engine
Aparna Chaudhary
 
Event Driven Architecture
Lourens Naudé
 
Real World Event Sourcing and CQRS
Matthew Hawkins
 
From legacy to DDD
Andrzej Krzywda
 
Siddhi: A Second Look at Complex Event Processing Implementations
Srinath Perera
 

Similar to Parallel Complex Event Processing (20)

PDF
Introducing the WSO2 Complex Event Processor
WSO2
 
PDF
Azure Streaming Analytics: A comprehensive Guide.
Iretioluwa Olawuyi
 
PPTX
Kapacitor - Real Time Data Processing Engine
Prashant Vats
 
PDF
WSO2 Product Release Webinar - Introducing the WSO2 Complex Event Processor
WSO2
 
PPTX
Introduction to WSO2 Data Analytics Platform
Srinath Perera
 
PDF
Stream Processing with Ballerina
Sriskandarajah Suhothayan
 
PPTX
Measurement .Net Performance with BenchmarkDotNet
Vasyl Senko
 
PDF
Monitoring InfluxEnterprise
InfluxData
 
PPTX
CAPL PPT which Includes Basic to Intermediate level
prabhakar144064
 
PPTX
Windows Remote Management - EN
Kirill Nikolaev
 
PDF
COM Events for Late-bound Delivery of Information
Arun Seetharaman
 
PDF
Virtual training Intro to Kapacitor
InfluxData
 
PDF
Solidity programming language and its different concepts with an example
PushpalathaB10
 
PDF
WSO2 Product Release Webinar - WSO2 Complex Event Processor
WSO2
 
PDF
26065613bjmmnnnnnnnnnnnjjjjjjjjjjjjjjjjjj
MAHESHV559910
 
PDF
Taming event-driven software via formal verification
AdaCore
 
PPTX
Advance sql - window functions patterns and tricks
Eyal Trabelsi
 
PDF
IBM MQ - Monitoring and Managing Hybrid Messaging Environments
MarkTaylorIBM
 
PPT
VB Script Overview
Praveen Gorantla
 
PPT
Tdd,Ioc
Antonio Radesca
 
Introducing the WSO2 Complex Event Processor
WSO2
 
Azure Streaming Analytics: A comprehensive Guide.
Iretioluwa Olawuyi
 
Kapacitor - Real Time Data Processing Engine
Prashant Vats
 
WSO2 Product Release Webinar - Introducing the WSO2 Complex Event Processor
WSO2
 
Introduction to WSO2 Data Analytics Platform
Srinath Perera
 
Stream Processing with Ballerina
Sriskandarajah Suhothayan
 
Measurement .Net Performance with BenchmarkDotNet
Vasyl Senko
 
Monitoring InfluxEnterprise
InfluxData
 
CAPL PPT which Includes Basic to Intermediate level
prabhakar144064
 
Windows Remote Management - EN
Kirill Nikolaev
 
COM Events for Late-bound Delivery of Information
Arun Seetharaman
 
Virtual training Intro to Kapacitor
InfluxData
 
Solidity programming language and its different concepts with an example
PushpalathaB10
 
WSO2 Product Release Webinar - WSO2 Complex Event Processor
WSO2
 
26065613bjmmnnnnnnnnnnnjjjjjjjjjjjjjjjjjj
MAHESHV559910
 
Taming event-driven software via formal verification
AdaCore
 
Advance sql - window functions patterns and tricks
Eyal Trabelsi
 
IBM MQ - Monitoring and Managing Hybrid Messaging Environments
MarkTaylorIBM
 
VB Script Overview
Praveen Gorantla
 
Ad

Recently uploaded (20)

PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PPTX
Darren Mills The Migration Modernization Balancing Act: Navigating Risks and...
AWS Chicago
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
Empowering Cloud Providers with Apache CloudStack and Stackbill
ShapeBlue
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PDF
Français Patch Tuesday - Juillet
Ivanti
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PPTX
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
PPTX
Extensions Framework (XaaS) - Enabling Orchestrate Anything
ShapeBlue
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PDF
July Patch Tuesday
Ivanti
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
Darren Mills The Migration Modernization Balancing Act: Navigating Risks and...
AWS Chicago
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
Empowering Cloud Providers with Apache CloudStack and Stackbill
ShapeBlue
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
Français Patch Tuesday - Juillet
Ivanti
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
Extensions Framework (XaaS) - Enabling Orchestrate Anything
ShapeBlue
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
July Patch Tuesday
Ivanti
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Ad

Parallel Complex Event Processing

  • 1. Parallel Complex Event Processing Karol Grzegorczyk 03-06-2013
  • 4. Complex Event Processing solutions ● Open Source: – – Drools Fusion – Storm – ● Esper WSO2 Complex Event Processor Proprietary software – Oracle Complex Event Processing – StreamBase Complex Event Processing – Informatica RulePoint – TIBCO Complex Event Processing
  • 5. Esper ● Two editions: ― Open source library ― Enterprise server based on Jetty ● Core component of Esper is a CEP engine. ● CEP engine is working like database turned upside-down ● Expressions are defined in Event Processing Language (EPL) ― Declarative domain specific language ― Similar with the SQL query language but differs from SQL in its use of views rather than tables and events instead of records (rows) ― Views are reused among EPL statements for efficiency! select * from OrderEvent.win:length(5)
  • 6. Streams ● Complex event can be build based on several data streams. select * from AlertEvent as a, NewsEvent as n where a.symbol = n.symbol ● Esper defines two types of data streams: ― Filter-based event stream select * from OrderEvent(itemType='shirt') ― Pattern-based event stream select * from pattern [ OrderEvent(itemType='shirt') -> OrderEvent(itemType='trousers')] ● It is possible to join between filter-based and pattern-based streams! ● Events can be forwarded to others streams using INSERT INTO keywords. ● It is also possible to update event (using UPDATE keyword) before it applies to any selecting statements
  • 7. Views ● ● ● Events are derived from streams (both filter- and pattern-based) by views Default view encloses all events from the stream since addition of the statement to the engine. View types: – Data windows (e.g. lenght, time) – Named windows – Extension Views (sorted window, rankied window, time-order view) – Standard views (unique, grouped, size, lastevent) – Statistics view (univariate, regression, correlation)
  • 8. Esper processing ● ● ● Update listeners and subscriber objects are associated with EPL statements By defualt listeners and subscribers are notified when new event that match EPL query arrive (insert stream) In addition listeners and subscribers can be notified when some event that match EPL query is removed from the stream (due to the limit of particular window)
  • 10. Filtering Esper provides two types of filtering: ● Stream-level filtering select * from OrderEvent(type= 'shirt') ● Post-data-window filtering select * from OrderEvent where type = 'shirt'
  • 13. Stream-level filtering vs post-data-window filtering select * from OrderEvent(type= 'shirt') vs select * from OrderEvent where type = 'shirt' The first form is preferred, but still sometimes post-data-window filtering is desired: Select one hundred orders and calculate average price of trousers. select avg(price) from OrderEvent.win:length(100) where type = 'trousers'
  • 14. Data Windows ● Basic windows: ― ― Length batch window (win:length_batch) ― Time window (win:time) ― ● Length window (win:length) Time batch window (win:time_batch) Advanced time windows ― Externally-timed window (win:ext_timed) ― Externally-timed batch window (win:ext_timed_batch) ― Time-Length combination batch window (win:time_length_batch) ― Time-Accumulating window (win:time_accum) ― Keep-All window (win:keepall) ― First Length (win:firstlength) ― First Time (win:firsttime)
  • 17. Scaling Esper ● ● According to the documentation Esper exceeds over 500 000 event/s on a dual CPU 2GHz Intel based hardware, with engine latency below 3 microseconds average (below 10us with more than 99% predictability) on a VWAP benchmark with 1000 statements registered in the system - this tops at 70 Mbit/s at 85% CPU usage. Parallel processing – Within one machine - – Context partitions With multiple machines - Partitioned stream - Partition by use case
  • 18. Context ● Context partition – basic level for locking ● By default single context partition ● Context types: ― ― Hash Segmented ― Category Segmented ― Non-overlapping context ― ● Keyed Segmented Overlapping context Nesting context
  • 19. Keyed Segmented Context create context ByCustomerAndAccount partition by custId and account from BankTxn context ByCustomerAndAccount select custId, account, sum(amount) from BankTxn Implicite grouping in select statement.
  • 20. Hash Segmented Context Assigns events to context partitions based on result of a hash function and modulo operation create context SegmentedByCustomerHash coalesce by hash_code (custId) from BankTxn granularity 16 preallocate context SegmentedByCustomerHash select custId, account, sum(amount) from BankTxn group by custId, account No implicite grouping in select statement!
  • 21. Category Segmented Context Assigns events to context partitions based on the values of one or more event properties, using a predicate expression(s) to define context partition membership. create context CategoryByTemp group temp < 65 as cold, group temp between 65 and 85 as normal, group temp > 85 as large from SensorEvent context CategoryByTemp select context.label, count(*) from SensorEvent
  • 22. Non-overlapping context Non-overlapping context is created when start condition is meet and ended when end condition is meet. There is always either one or zero context partions. create context NineToFive start (0, 9, *, *, *) end (0, 17, *, *, *) context NineToFive select * from TrafficEvent(speed >= 100)
  • 23. Overlapping context This context initiates a new context partition when an initiating condition occurs, and terminates one or more context partitions when the terminating condition occurs. create context CtxTrainEnter initiated by TrainEnterEvent as te terminated after 5 minutes context CtxTrainEnter select t1 from pattern [t1=TrainEnterEvent -> timer:interval(5 min) and not TrainLeaveEvent(trainId = context.te.trainId)]
  • 24. Context nesting In case of nested contextx the context declared first controls the lifecycle of the context(s) declared thereafter. create context NineToFiveSegmented context NineToFive start (0, 9, *, *, *) end (0, 17, *, *, *), context SegmentedByCustomer partition by custId from BankTxn context NineToFiveSegmented select custId, account, sum(amount) from BankTxn group by account
  • 25. Partitioning without context declaration Grouped data window std:groupwin() What is the difference between: select avg(price) from OrderEvent.std:groupwin(itemType).win:length(10) And select avg(price) from OrderEvent.win:length(10) group by itemType ?
  • 26. Parallel processing on multiple machines Partitioned stream ● Partition by use case ●

Editor's Notes

  • #4: CEP assumes multiple sources Synonym of CEP is &apos;event correlation&apos;.
  • #6: Whereas a typical database stores data, and runs queries against the data, a CEP data stores queries, and runs data through the queries. Language to specify expression-based event pattern matching
  • #8: Does the &apos;insert into&apos; is used to insert into other streams of events or only into named windows?
  • #9: Data windows will be discussed later
  • #15: Stream-level-filtering allows only simple filters
  • #16: In case of post-data-window filtering update listener is not notified, but window is used (filled) Post-data-window filtering allows more sophisticated filtering
  • #17: Stream-level filetering has built in optimization. Sometimes post-data-window is neede
  • #34: The granularity defines the maximum degree of parallelism