SlideShare a Scribd company logo
1 of 41
Download to read offline
High Available Complex Event Processing
with Red Hat JBoss BRMS
Duncan Doyle
Senior Architect, Red Hat
Who am I?
•Duncan Doyle
•Senior Architect @ Red Hat Consulting
•EMEA Architect Team
•JBoss Middleware
•EAP
•SOA-P
•Data Grid
•BRMS/BPMSuite
•Rotterdam, The Netherlands
Agenda
•What is Complex Event Processing (CEP)?
•What is High Availability (HA)?
•Challenges when combining HA and CEP
•Architectural Quest
• Persistence Architecture
• Replay Architecture
• Active-Active Architecture
•Keeping things in-sync
•Conclusion
What is Complex Event Processing?
•What is an Event?
A significant change of state at a particular point in time.
•What is Complex Event Processing?
The ability to detect, correlate, abstract, aggregate or compose and
react to events.
Red Hat JBoss BRMS Enables:
Event Detection
From an event cloud or set of streams, select all the meaningful events
and only then:
(Temporal) Event Correlation
Ability to correlate events and facts declaring both temporal and non-
temporal constraints between them. Ability to reason over event
aggregation.
Event abstraction
Ability to compose complex events from atomic events AND reason over
them.
A small CEP Example
What is High Availability?
High availability is a system design approach and associated service
implementation that ensures a prearranged level of operational performance will
be met during a contractual measurement period.
• 0-downtime?
• MTBF, MTTR?
• Requirements?
• Is limited downtime acceptable?
• How much downtime is acceptable?
• Is state-loss acceptable?
• Costs, Probability, Risks?
JBoss EAP High Availability
Multi-node (active-active) setup (HA):
•mod_cluster
•sticky-sessions
•application(s) deployed to all nodes.
Clustered setup (HA + Failover):
•JGroups cluster:
•Web Session replication (Infinispan)
•SFSB replication (Infinispan)
•HornetQ cluster
•Cluster (HA)
•Live/Backup (Failover)
JBoss BRMS HA CEP Challenges
Sessions are:
• Stateful
State needs to be persisted.
• Used by all Events
Sessions are not partitioned per event type, user, session-id, etc (like, for
example, HTTP sessions).
• Long lived sessions (days), which are (usually) very Large and therefore
consume a lot of memory
Full persistence of state is expensive.
•Unless we can partition our events, all events are stored in the same session!
Persistence Architecture
The session is persisted after every event insert + rule firing.
On system failure, the system is restarted and the session is
reloaded from the persistence store.
Session can be stored on HA storage (Gluster, SAN, etc.).
Persistence Architecture
Pro:
• Easy to implement.
• Easy to maintain.
• Requires only a single processing node.
Con:
• System is down during restart and session restore.
• Very naïve implementation: Performance
• and …... Performance
• and …. Performance
Replay Architecture
Events are stored in big-data storage (e.g. JBoss Data Grid).
On system failure, a new JBoss BRMS CEP Session is created
and events are replayed to restore the state of the session.
Replay Architecture
Pro:
• Requires only a single processing node.
• No continuous session persistence.
Con:
• System is down during restart, restore and replay.
• Event persistence maintenance (store/remove message)
•How to re-create the exact same state of the system?
•When can we discard events?
• Duplicate output (i.e. rule RHS executed twice for replayed events).
Replay & Persistence Architecture
Events are stored in big-data storage (e.g. JBoss Data Grid).
Sessions are stored periodically creating save-points.
On system failure, restore the session from the save-point, and replay the events
to restore the full state of the session (Event Sourcing).
Resolves (part of) the event persistence maintenance problem. Events can be
discarded when the session is saved.
Replay & Persistence Architecture
Pro:
• Requires only a single processing node.
• Easier maintenance. Events can be discarded when the save-point has been
created.
Con:
• System is down during restart, restore and replay.
• Duplicate output (i.e. rule RHS executed twice for replayed events).
Active-Active Architecture
2 + n nodes processing the same events in parallel.
No persistence: on failure, the other node will take over.
Only one node executes the rule consequence.
Active-Active Architecture
Pro:
• Seamless failover (no event replay required).
• No need to store events.
Con:
• Multiple nodes required.
• Sessions need to be kept in-sync.
• As there are multiple CEP engines firing rules, the of the engines needs to be
controlled. I.e. only one of the nodes is allowed to execute the rule
consequence (or action).
• How do we revive a failed instance?
Active-Active + Persistence + Replay Architecture
2 + n nodes processing the same events in parallel.
Sessions are stored periodically creating save-points.
On system failure, restore the session from the save-point, and replay the events to
restore the full state of the session.
Only one node executes the rule consequence.
Event Sourcing: the state the systems are kept in-sync by the 'Event Sourcing' principal:
The state of the system can be recreated by replaying the events on a base-line.
Active-Active + Persistence + Replay Architecture
Pro:
• Seamless failover (no event replay required).
• Easier maintenance. Events can be discarded when the save-point has been
created.
• Instances can be restored by loading the save-point and replaying events.
Con:
• Multiple nodes required.
• Sessions need to be kept in-sync.
• As there are multiple CEP engines firing rules, the of the engines needs to be
controlled. I.e. only one of the nodes is allowed to execute the rule
consequence (or action).
Keeping Stuff In-Sync
Agenda
• Agenda contains the matches/activations of rules that will be fired. These need to be in-sync
so on failover, the backup node will continue firing rules where the master stopped.
Events
• Each node needs to receive the same events in the same order.
Clock
• Due to temporal reasoning, the clock of the nodes needs to be kept in-sync to keep the WM
and Agenda in-sync.
Working Memory
• The WorkingMemory (session state) needs to be kept in exact sync so the Agenda will be
kept in-sync.
Keeping the Agenda in-sync
Why can't we just discard rule-firing on the slave? I.e using an
AgendaFilter:
• On failover, the backup node needs to continue firing rules where the master
stopped.
• RHS of a rule can influence the state of the WM, i.e. insert, update, discard
Events/Facts, or push agenda groups.
Therefore, rules need to be put on the agenda and fired on both
the master and the slaves. Output of the slaves needs to be
discarded.
Keeping Events in-sync
•All Events have a UUID and a timestamp.
•Direct, non-deterministic manipulation of the session is not
allowed (e.g. insert/update/delete fact).
•Events need to processed in the exact same order on both
engines.
• For example by using strict-message ordering at the receiver.
Synchronizing the Clock
Due to the temporal reasoning in the engine, the clock needs to be
kept in-sync.
Easiest solution: Use the pseudo-clock and advance the clock based on the
timestamp of the events:
This keeps the clocks in-sync without communication between the nodes, as long
as the order of events entering the systems is the same on all nodes.
Working Memory Synchronization
By keeping the clock in-sync, keeping the order of events in-sync
and by adhering to these constraints, the working memory of the
engines can be kept in-sync:
• All Events have a UUID and a timestamp.
• Use the pseudo-clock and advance clock based on the timestamp of the incoming
fact.
• Direct, non-deterministic manipulation of the session is not allowed (e.g.
insert/update/delete fact).
• CEP Engine actions are wrapped in Command objects. Engine is not allowed to
directly interact with other systems.
• Command Objects have an ID that can be deterministically computed in the
individual nodes.
Working Memory Synchronization
Rules need to be fired after the same event 'insert' on both engines
for the engines to behave deterministically. This can for example
be done by:
•Firing after a defined 'batch' size.
•Using 'poison-pills'.
AND DON'T USE
ksession.fireUntilHalt()!!!!
Working Memory Synchronization
The Command Object ID can be used to detect duplicate
commands between engines and can be calculated from the rule
Match:
• Rule Package
• Rule Name
• Event UUIDs
This concept allows to both:
• Run 2 engines in parallel and executing the RHS only once by using duplicate
detection (i.e. idempotency principal).
• Replaying events and filtering already fired RHSs.
JBoss BRMS HA CEP
Architectural Decisions recap
•All Events have a UUID and a timestamp.
•Direct, non-deterministic manipulation of the session is not
allowed (e.g. insert/update/delete fact).
•Use the pseudo-clock and advance clock based on the timestamp
of the incoming fact.
•CEP Engine actions are wrapped in Command objects. Engine is
not allowed to directly interact with other systems.
•Command Objects have an ID that can be deterministically
computed in the individual nodes.
JBoss BRMS HA CEP
Architectural Decisions recap
•Commands are not directly executed by the engines, instead,
CommandDispatchers are responsible for sending the Commands to
be executed to a CommandExecutor.
•CommandDispatchers will execute a Command 'once-and-only-once'.
•Commands have a unique id per engine. This ID can be
deterministically computed.
•Idempotency principle is implemented by discarding commands that
have already been executed.
• This allows for both parallel engine processing and session restoring via
replay architecture without executing actions twice.
Conclusion
•JBoss BRMS CEP adds powerful semantics to existing
architectures.
•JBoss BRMS can be setup as a highly available system.
•There are multiple architectures possible to setup a HA CEP
system. Which architecture to use highly depends on the system
requirements (i.e. acceptable downtime, state-loss, etc.).
•JBoss BRMS HA CEP does not come out-of-the-box.
Questions?

More Related Content

Viewers also liked

All the cool stuff of JBoss BRMS
All the cool stuff of JBoss BRMSAll the cool stuff of JBoss BRMS
All the cool stuff of JBoss BRMSJBug Italy
 
A look into the crystal ball at JBoss BRMS and BPM Suite
 A look into the crystal ball at JBoss BRMS and BPM Suite A look into the crystal ball at JBoss BRMS and BPM Suite
A look into the crystal ball at JBoss BRMS and BPM SuiteEric D. Schabell
 
Improve your organization’s capability for faster growth and change with BPM,...
Improve your organization’s capability for faster growth and change with BPM,...Improve your organization’s capability for faster growth and change with BPM,...
Improve your organization’s capability for faster growth and change with BPM,...Eric D. Schabell
 
Application Architecture -Data, Process, Rule-
Application Architecture -Data, Process, Rule-Application Architecture -Data, Process, Rule-
Application Architecture -Data, Process, Rule-Masahiko Umeno
 
Zero to Hero Using Red Hat JBoss BRMS
Zero to Hero Using Red Hat JBoss BRMSZero to Hero Using Red Hat JBoss BRMS
Zero to Hero Using Red Hat JBoss BRMSEric D. Schabell
 
Online Free PEX Webinar - A Guide to Modern BPM Tools
Online Free PEX Webinar - A Guide to Modern BPM ToolsOnline Free PEX Webinar - A Guide to Modern BPM Tools
Online Free PEX Webinar - A Guide to Modern BPM ToolsEric D. Schabell
 
Qwr iso20000 auditor m04 implementing audit and tooling us 06 apr14
Qwr iso20000 auditor m04 implementing audit and tooling us 06 apr14Qwr iso20000 auditor m04 implementing audit and tooling us 06 apr14
Qwr iso20000 auditor m04 implementing audit and tooling us 06 apr14said missoum
 
Business rules management system
Business rules management systemBusiness rules management system
Business rules management systemPliant Framework
 
หน่วยที่1 แนวคิดเกี่ยวกับการจัดการคุณภาพ
หน่วยที่1 แนวคิดเกี่ยวกับการจัดการคุณภาพหน่วยที่1 แนวคิดเกี่ยวกับการจัดการคุณภาพ
หน่วยที่1 แนวคิดเกี่ยวกับการจัดการคุณภาพอัยเหี้ยม ยัยห้อย
 
Business rule and decision engine
Business rule and decision engineBusiness rule and decision engine
Business rule and decision enginePliant Framework
 
Business Rules - Design and Modeling Guidelines
Business Rules - Design and Modeling GuidelinesBusiness Rules - Design and Modeling Guidelines
Business Rules - Design and Modeling GuidelinesKeshav Deshpande
 
Decision services for soa platforms
Decision services for soa platformsDecision services for soa platforms
Decision services for soa platformsPliant Framework
 
2007 11-09 mm (costa rica - incae cit omg) modeling with bpmn and xpdl
2007 11-09 mm (costa rica - incae cit omg) modeling with bpmn and xpdl2007 11-09 mm (costa rica - incae cit omg) modeling with bpmn and xpdl
2007 11-09 mm (costa rica - incae cit omg) modeling with bpmn and xpdlMike Marin
 
Building highly scalable process and rule-driven applications with JBoss Ente...
Building highly scalable process and rule-driven applications with JBoss Ente...Building highly scalable process and rule-driven applications with JBoss Ente...
Building highly scalable process and rule-driven applications with JBoss Ente...Eric D. Schabell
 
Semantically-Enabled Business Process Management
Semantically-Enabled Business Process ManagementSemantically-Enabled Business Process Management
Semantically-Enabled Business Process ManagementAdrian Paschke
 
Marketo LaunchPoint
Marketo LaunchPoint Marketo LaunchPoint
Marketo LaunchPoint Marketo
 
การจัดการคุณภาพ 1
การจัดการคุณภาพ 1การจัดการคุณภาพ 1
การจัดการคุณภาพ 1Thida Noodaeng
 
Bpms ecu2014
Bpms ecu2014Bpms ecu2014
Bpms ecu2014Bob Brodt
 

Viewers also liked (20)

All the cool stuff of JBoss BRMS
All the cool stuff of JBoss BRMSAll the cool stuff of JBoss BRMS
All the cool stuff of JBoss BRMS
 
A look into the crystal ball at JBoss BRMS and BPM Suite
 A look into the crystal ball at JBoss BRMS and BPM Suite A look into the crystal ball at JBoss BRMS and BPM Suite
A look into the crystal ball at JBoss BRMS and BPM Suite
 
Improve your organization’s capability for faster growth and change with BPM,...
Improve your organization’s capability for faster growth and change with BPM,...Improve your organization’s capability for faster growth and change with BPM,...
Improve your organization’s capability for faster growth and change with BPM,...
 
Application Architecture -Data, Process, Rule-
Application Architecture -Data, Process, Rule-Application Architecture -Data, Process, Rule-
Application Architecture -Data, Process, Rule-
 
Zero to Hero Using Red Hat JBoss BRMS
Zero to Hero Using Red Hat JBoss BRMSZero to Hero Using Red Hat JBoss BRMS
Zero to Hero Using Red Hat JBoss BRMS
 
Online Free PEX Webinar - A Guide to Modern BPM Tools
Online Free PEX Webinar - A Guide to Modern BPM ToolsOnline Free PEX Webinar - A Guide to Modern BPM Tools
Online Free PEX Webinar - A Guide to Modern BPM Tools
 
Qwr iso20000 auditor m04 implementing audit and tooling us 06 apr14
Qwr iso20000 auditor m04 implementing audit and tooling us 06 apr14Qwr iso20000 auditor m04 implementing audit and tooling us 06 apr14
Qwr iso20000 auditor m04 implementing audit and tooling us 06 apr14
 
L4
L4L4
L4
 
Business rules management system
Business rules management systemBusiness rules management system
Business rules management system
 
หน่วยที่1 แนวคิดเกี่ยวกับการจัดการคุณภาพ
หน่วยที่1 แนวคิดเกี่ยวกับการจัดการคุณภาพหน่วยที่1 แนวคิดเกี่ยวกับการจัดการคุณภาพ
หน่วยที่1 แนวคิดเกี่ยวกับการจัดการคุณภาพ
 
Business rule and decision engine
Business rule and decision engineBusiness rule and decision engine
Business rule and decision engine
 
Business Rules - Design and Modeling Guidelines
Business Rules - Design and Modeling GuidelinesBusiness Rules - Design and Modeling Guidelines
Business Rules - Design and Modeling Guidelines
 
Decision services for soa platforms
Decision services for soa platformsDecision services for soa platforms
Decision services for soa platforms
 
2007 11-09 mm (costa rica - incae cit omg) modeling with bpmn and xpdl
2007 11-09 mm (costa rica - incae cit omg) modeling with bpmn and xpdl2007 11-09 mm (costa rica - incae cit omg) modeling with bpmn and xpdl
2007 11-09 mm (costa rica - incae cit omg) modeling with bpmn and xpdl
 
Building highly scalable process and rule-driven applications with JBoss Ente...
Building highly scalable process and rule-driven applications with JBoss Ente...Building highly scalable process and rule-driven applications with JBoss Ente...
Building highly scalable process and rule-driven applications with JBoss Ente...
 
Semantically-Enabled Business Process Management
Semantically-Enabled Business Process ManagementSemantically-Enabled Business Process Management
Semantically-Enabled Business Process Management
 
Marketo LaunchPoint
Marketo LaunchPoint Marketo LaunchPoint
Marketo LaunchPoint
 
101ch6
101ch6101ch6
101ch6
 
การจัดการคุณภาพ 1
การจัดการคุณภาพ 1การจัดการคุณภาพ 1
การจัดการคุณภาพ 1
 
Bpms ecu2014
Bpms ecu2014Bpms ecu2014
Bpms ecu2014
 

Similar to Doyle h 0945-high-availablity-cep-with-red_hat-j_boss_brms-3

Real time operating system
Real time operating systemReal time operating system
Real time operating systemKhuram Shahzad
 
EMBEDDED OS
EMBEDDED OSEMBEDDED OS
EMBEDDED OSAJAL A J
 
Unit 2_OS process management
Unit 2_OS process management Unit 2_OS process management
Unit 2_OS process management JayeshGadhave1
 
Intro Basic of OS .ppt
Intro Basic of OS .pptIntro Basic of OS .ppt
Intro Basic of OS .pptVarsha506533
 
Chapter -2 operating system presentation
Chapter -2 operating system presentationChapter -2 operating system presentation
Chapter -2 operating system presentationchnrketan
 
How Operating system works.
How Operating system works. How Operating system works.
How Operating system works. Fahad Farooq
 
Computer system architecture
Computer system architectureComputer system architecture
Computer system architecturejeetesh036
 
Product Information - Fuse Management Central 1.0.0
Product Information - Fuse Management Central 1.0.0Product Information - Fuse Management Central 1.0.0
Product Information - Fuse Management Central 1.0.0antonio.carvalho
 
Engg-0505-IT-Operating-Systems-2nd-year.pdf
Engg-0505-IT-Operating-Systems-2nd-year.pdfEngg-0505-IT-Operating-Systems-2nd-year.pdf
Engg-0505-IT-Operating-Systems-2nd-year.pdfnikhil287188
 
Real Time Systems
Real Time SystemsReal Time Systems
Real Time Systemsleo3004
 
Module 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModul...
Module 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModul...Module 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModul...
Module 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModul...morganjohn3
 
Process scheduling & time
Process scheduling & timeProcess scheduling & time
Process scheduling & timeYojana Nanaware
 
Azure Function Workflow
Azure Function WorkflowAzure Function Workflow
Azure Function WorkflowAndrea Tosato
 
Operating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdfOperating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdfFahanaAbdulVahab
 

Similar to Doyle h 0945-high-availablity-cep-with-red_hat-j_boss_brms-3 (20)

Real time operating system
Real time operating systemReal time operating system
Real time operating system
 
EMBEDDED OS
EMBEDDED OSEMBEDDED OS
EMBEDDED OS
 
Autosar Basics hand book_v1
Autosar Basics  hand book_v1Autosar Basics  hand book_v1
Autosar Basics hand book_v1
 
Unit 2_OS process management
Unit 2_OS process management Unit 2_OS process management
Unit 2_OS process management
 
13009690.ppt
13009690.ppt13009690.ppt
13009690.ppt
 
Real time operating systems
Real time operating systemsReal time operating systems
Real time operating systems
 
Aws meetup ssm
Aws meetup ssmAws meetup ssm
Aws meetup ssm
 
Intro Basic of OS .ppt
Intro Basic of OS .pptIntro Basic of OS .ppt
Intro Basic of OS .ppt
 
Chapter -2 operating system presentation
Chapter -2 operating system presentationChapter -2 operating system presentation
Chapter -2 operating system presentation
 
How Operating system works.
How Operating system works. How Operating system works.
How Operating system works.
 
Computer system architecture
Computer system architectureComputer system architecture
Computer system architecture
 
Product Information - Fuse Management Central 1.0.0
Product Information - Fuse Management Central 1.0.0Product Information - Fuse Management Central 1.0.0
Product Information - Fuse Management Central 1.0.0
 
Engg-0505-IT-Operating-Systems-2nd-year.pdf
Engg-0505-IT-Operating-Systems-2nd-year.pdfEngg-0505-IT-Operating-Systems-2nd-year.pdf
Engg-0505-IT-Operating-Systems-2nd-year.pdf
 
Real Time Systems
Real Time SystemsReal Time Systems
Real Time Systems
 
Operating System
Operating SystemOperating System
Operating System
 
Module 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModul...
Module 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModul...Module 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModul...
Module 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModul...
 
Process scheduling & time
Process scheduling & timeProcess scheduling & time
Process scheduling & time
 
Operating System
Operating SystemOperating System
Operating System
 
Azure Function Workflow
Azure Function WorkflowAzure Function Workflow
Azure Function Workflow
 
Operating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdfOperating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdf
 

Recently uploaded

04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationshipsccctableauusergroup
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% SecurePooja Nehwal
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysismanisha194592
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystSamantha Rae Coolbeth
 
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiLow Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiSuhani Kapoor
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998YohFuh
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxStephen266013
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfLars Albertsson
 
Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxfirstjob4
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxolyaivanovalion
 
Ukraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSUkraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSAishani27
 
Edukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxEdukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxolyaivanovalion
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfRachmat Ramadhan H
 
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改atducpo
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Delhi Call girls
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptxAnupama Kate
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFxolyaivanovalion
 

Recently uploaded (20)

04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data Analyst
 
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiLow Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docx
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdf
 
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
 
Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptx
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptx
 
Ukraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSUkraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICS
 
Edukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxEdukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFx
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
 
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFx
 

Doyle h 0945-high-availablity-cep-with-red_hat-j_boss_brms-3

  • 1. High Available Complex Event Processing with Red Hat JBoss BRMS Duncan Doyle Senior Architect, Red Hat
  • 2. Who am I? •Duncan Doyle •Senior Architect @ Red Hat Consulting •EMEA Architect Team •JBoss Middleware •EAP •SOA-P •Data Grid •BRMS/BPMSuite •Rotterdam, The Netherlands
  • 3. Agenda •What is Complex Event Processing (CEP)? •What is High Availability (HA)? •Challenges when combining HA and CEP •Architectural Quest • Persistence Architecture • Replay Architecture • Active-Active Architecture •Keeping things in-sync •Conclusion
  • 4. What is Complex Event Processing? •What is an Event? A significant change of state at a particular point in time. •What is Complex Event Processing? The ability to detect, correlate, abstract, aggregate or compose and react to events.
  • 5. Red Hat JBoss BRMS Enables: Event Detection From an event cloud or set of streams, select all the meaningful events and only then: (Temporal) Event Correlation Ability to correlate events and facts declaring both temporal and non- temporal constraints between them. Ability to reason over event aggregation. Event abstraction Ability to compose complex events from atomic events AND reason over them.
  • 6. A small CEP Example
  • 7. What is High Availability? High availability is a system design approach and associated service implementation that ensures a prearranged level of operational performance will be met during a contractual measurement period. • 0-downtime? • MTBF, MTTR? • Requirements? • Is limited downtime acceptable? • How much downtime is acceptable? • Is state-loss acceptable? • Costs, Probability, Risks?
  • 8. JBoss EAP High Availability Multi-node (active-active) setup (HA): •mod_cluster •sticky-sessions •application(s) deployed to all nodes. Clustered setup (HA + Failover): •JGroups cluster: •Web Session replication (Infinispan) •SFSB replication (Infinispan) •HornetQ cluster •Cluster (HA) •Live/Backup (Failover)
  • 9.
  • 10. JBoss BRMS HA CEP Challenges Sessions are: • Stateful State needs to be persisted. • Used by all Events Sessions are not partitioned per event type, user, session-id, etc (like, for example, HTTP sessions). • Long lived sessions (days), which are (usually) very Large and therefore consume a lot of memory Full persistence of state is expensive. •Unless we can partition our events, all events are stored in the same session!
  • 11.
  • 12. Persistence Architecture The session is persisted after every event insert + rule firing. On system failure, the system is restarted and the session is reloaded from the persistence store. Session can be stored on HA storage (Gluster, SAN, etc.).
  • 13.
  • 14. Persistence Architecture Pro: • Easy to implement. • Easy to maintain. • Requires only a single processing node. Con: • System is down during restart and session restore. • Very naïve implementation: Performance • and …... Performance • and …. Performance
  • 15. Replay Architecture Events are stored in big-data storage (e.g. JBoss Data Grid). On system failure, a new JBoss BRMS CEP Session is created and events are replayed to restore the state of the session.
  • 16.
  • 17. Replay Architecture Pro: • Requires only a single processing node. • No continuous session persistence. Con: • System is down during restart, restore and replay. • Event persistence maintenance (store/remove message) •How to re-create the exact same state of the system? •When can we discard events? • Duplicate output (i.e. rule RHS executed twice for replayed events).
  • 18. Replay & Persistence Architecture Events are stored in big-data storage (e.g. JBoss Data Grid). Sessions are stored periodically creating save-points. On system failure, restore the session from the save-point, and replay the events to restore the full state of the session (Event Sourcing). Resolves (part of) the event persistence maintenance problem. Events can be discarded when the session is saved.
  • 19.
  • 20. Replay & Persistence Architecture Pro: • Requires only a single processing node. • Easier maintenance. Events can be discarded when the save-point has been created. Con: • System is down during restart, restore and replay. • Duplicate output (i.e. rule RHS executed twice for replayed events).
  • 21. Active-Active Architecture 2 + n nodes processing the same events in parallel. No persistence: on failure, the other node will take over. Only one node executes the rule consequence.
  • 22.
  • 23. Active-Active Architecture Pro: • Seamless failover (no event replay required). • No need to store events. Con: • Multiple nodes required. • Sessions need to be kept in-sync. • As there are multiple CEP engines firing rules, the of the engines needs to be controlled. I.e. only one of the nodes is allowed to execute the rule consequence (or action). • How do we revive a failed instance?
  • 24. Active-Active + Persistence + Replay Architecture 2 + n nodes processing the same events in parallel. Sessions are stored periodically creating save-points. On system failure, restore the session from the save-point, and replay the events to restore the full state of the session. Only one node executes the rule consequence. Event Sourcing: the state the systems are kept in-sync by the 'Event Sourcing' principal: The state of the system can be recreated by replaying the events on a base-line.
  • 25.
  • 26. Active-Active + Persistence + Replay Architecture Pro: • Seamless failover (no event replay required). • Easier maintenance. Events can be discarded when the save-point has been created. • Instances can be restored by loading the save-point and replaying events. Con: • Multiple nodes required. • Sessions need to be kept in-sync. • As there are multiple CEP engines firing rules, the of the engines needs to be controlled. I.e. only one of the nodes is allowed to execute the rule consequence (or action).
  • 27. Keeping Stuff In-Sync Agenda • Agenda contains the matches/activations of rules that will be fired. These need to be in-sync so on failover, the backup node will continue firing rules where the master stopped. Events • Each node needs to receive the same events in the same order. Clock • Due to temporal reasoning, the clock of the nodes needs to be kept in-sync to keep the WM and Agenda in-sync. Working Memory • The WorkingMemory (session state) needs to be kept in exact sync so the Agenda will be kept in-sync.
  • 28. Keeping the Agenda in-sync Why can't we just discard rule-firing on the slave? I.e using an AgendaFilter: • On failover, the backup node needs to continue firing rules where the master stopped. • RHS of a rule can influence the state of the WM, i.e. insert, update, discard Events/Facts, or push agenda groups. Therefore, rules need to be put on the agenda and fired on both the master and the slaves. Output of the slaves needs to be discarded.
  • 29.
  • 30. Keeping Events in-sync •All Events have a UUID and a timestamp. •Direct, non-deterministic manipulation of the session is not allowed (e.g. insert/update/delete fact). •Events need to processed in the exact same order on both engines. • For example by using strict-message ordering at the receiver.
  • 31. Synchronizing the Clock Due to the temporal reasoning in the engine, the clock needs to be kept in-sync. Easiest solution: Use the pseudo-clock and advance the clock based on the timestamp of the events: This keeps the clocks in-sync without communication between the nodes, as long as the order of events entering the systems is the same on all nodes.
  • 32. Working Memory Synchronization By keeping the clock in-sync, keeping the order of events in-sync and by adhering to these constraints, the working memory of the engines can be kept in-sync: • All Events have a UUID and a timestamp. • Use the pseudo-clock and advance clock based on the timestamp of the incoming fact. • Direct, non-deterministic manipulation of the session is not allowed (e.g. insert/update/delete fact). • CEP Engine actions are wrapped in Command objects. Engine is not allowed to directly interact with other systems. • Command Objects have an ID that can be deterministically computed in the individual nodes.
  • 33. Working Memory Synchronization Rules need to be fired after the same event 'insert' on both engines for the engines to behave deterministically. This can for example be done by: •Firing after a defined 'batch' size. •Using 'poison-pills'. AND DON'T USE ksession.fireUntilHalt()!!!!
  • 34. Working Memory Synchronization The Command Object ID can be used to detect duplicate commands between engines and can be calculated from the rule Match: • Rule Package • Rule Name • Event UUIDs This concept allows to both: • Run 2 engines in parallel and executing the RHS only once by using duplicate detection (i.e. idempotency principal). • Replaying events and filtering already fired RHSs.
  • 35.
  • 36.
  • 37.
  • 38. JBoss BRMS HA CEP Architectural Decisions recap •All Events have a UUID and a timestamp. •Direct, non-deterministic manipulation of the session is not allowed (e.g. insert/update/delete fact). •Use the pseudo-clock and advance clock based on the timestamp of the incoming fact. •CEP Engine actions are wrapped in Command objects. Engine is not allowed to directly interact with other systems. •Command Objects have an ID that can be deterministically computed in the individual nodes.
  • 39. JBoss BRMS HA CEP Architectural Decisions recap •Commands are not directly executed by the engines, instead, CommandDispatchers are responsible for sending the Commands to be executed to a CommandExecutor. •CommandDispatchers will execute a Command 'once-and-only-once'. •Commands have a unique id per engine. This ID can be deterministically computed. •Idempotency principle is implemented by discarding commands that have already been executed. • This allows for both parallel engine processing and session restoring via replay architecture without executing actions twice.
  • 40. Conclusion •JBoss BRMS CEP adds powerful semantics to existing architectures. •JBoss BRMS can be setup as a highly available system. •There are multiple architectures possible to setup a HA CEP system. Which architecture to use highly depends on the system requirements (i.e. acceptable downtime, state-loss, etc.). •JBoss BRMS HA CEP does not come out-of-the-box.