Getting Started
Complex Event Processing
The primary goal of BoboCEP is to take streaming data that enters a
system in a serialised and uncorrelated manner (i.e., simple events),
and detect temporal patterns using it to infer the occurrence of some
higher-level phenomenon.
A complex event may be generated if a pattern of a phenomenon is fulfilled
with relevant data.
See Phenomena for more information.
On pattern fulfilment, an action may be taken in response which, in turn, leads to the generation of an action event representing what happened during action execution and whether it was successfully executed. See Actions for more information.
Complex events and action events are added back into the system’s data stream, where they can be used for use in future pattern detection. See the Glossary for definitions of any unfamiliar terminology.
Example
An office may wish to detect the phenomenon of an office fire through various data patterns that could infer its occurrence. Patterns may include:
A sharp rise in temperature sensor readings, followed by smoke detection within 1 minute of the rise in temperature.
Significant movement away from working spaces and towards the fire exit.
Or, it may simply be the pressing of the fire alarm, with no further correlations necessary.
When any of these patterns are fulfilled by the expected data, a number of actions may be triggered as a response: fire alarms sound, sprinklers are activated, and so on.
BoboCEP Architecture
The architecture of BoboCEP is based on the
information flow processing (IFP) architecture proposed by [CM2012].
This architecture is extended by enabling state updates to be synchronised
across multiple instances of BoboCEP across a network for fault
tolerance.
BoboCEP architecture and external systems.
Subsystems within dashed border are the core subsystems for a given
BoboCEP instance.
Dotted arrows represent data exchange to and from external systems
(blue, grey).
Engine
BoboCEP is powered by a BoboEngine instance, which maintains
data flow by sequentially executing its IFP subsystems in a round-robin
fashion, as follows:
The Receiver processes data entering the system, ensuring all data leaving the Receiver is a
BoboEventinstance.The Decider checks each event against its patterns: instantiating, halting, advancing, and completing runs as necessary.
The Producer generates a
BoboEventComplexinstance for a newly completed run, which is also sent to the Receiver.The Forwarder executes the complex event’s corresponding action and generates a
BoboEventActioninstance once it has finished, which is also sent to the Receiver.
The subsystems are discussed in more detail below.
Receiver
The Receiver is the entry point for data into the system. Its purpose is to validate incoming data and then format it into a simple event. It also consumes complex events and action events and introduces these event types into the data stream.
Data of
Anytype entersBoboReceivervia theadd_datamethod.If the data is an instance of type
BoboEvent, then it is passed toBoboDecideras-is.Otherwise, Receiver will wrap the data in a new
BoboEventSimpleinstancee, wheree.datais the data passed viaadd_data, and will sendeto Decider instead.A
BoboValidatorinstance is provided to the Receiver to ensure that all data must pass some validation criteria in order to be accepted by the system. For example,BoboValidatorJSONableensures all data are valid JSON. This validator is essential when using DistributedBoboCEPto ensure all data in the system are serialisable. See Distributed for more information.
Decider
The Decider manages runs, which represent instances of patterns that require data to fulfil its predicates. Once its predicates have been satisfied by a sequence of applicable events, the run is completed.
A
BoboPhenomenoncontains one or moreBoboPatterninstances and aBoboActioninstance.A
BoboRunis created when the first predicate of aBoboPatternis satisfied with someBoboEvent.Once a run has had its final predicate satisfied, Producer is notified.
Producer
The Producer generates a complex event when it receives notification from the Decider that a run has completed. The complex event is considered as a representation of a phenomenon that has been observed, as per the fulfilment of its pattern via the completed run.
When a Run has completed,
BoboProducerwill produce aBoboEventComplexinstance, indicating the observation of the phenomenon that the pattern is evidence of.The Producer passes the complex event to Forwarder, in order to trigger the phenomenon’s corresponding
BoboActon. It also passes the complex event to Receiver, which adds it to the data stream.
Forwarder
The Forwarder triggers actions passed to it by Producer and executes them. This may involve communication with external services. Each action leads to the generation of an action event that details what occurred during action execution.
BoboForwarderchecks the complex event against its phenomenon to determine which action it needs to execute, if any.It executes the action and produces a corresponding
BoboEventActionthat contains reference to the complex event which led to its execution.The
BoboEventActionis passed to the Receiver and added to the data stream.
Distributed
BoboCEP is able to be executed across multiple software instances
and remain synchronised, such that each instance maintains an identical copy
of system state through active replication.
See Distributed for more information.
Quick Start
The key components to getting started with BoboCEP are as follows.
Define the Phenomena that you would like to model by defining one or more patterns per phenomenon. Use
BoboPatternBuilderfor defining patterns to make things much easier.Define Actions that should be executed if a phenomenon were to be triggered. Allocate an action to a phenomenon if you wish, or leave it blank.
Decide whether you want BoboCEP to be Distributed or not, and use one of the setup classes to help with setting up the system engine and all of its components:
BoboSetupSimpleandBoboSetupSimpleDistributedare provided for these purposes.
Check out the Examples page for various ways to
set up BoboCEP and connect it to external systems (e.g., Flask).
To explore the API in more detail, see Source Code.
Why “Bobo”?
Bobo is the name of Mr Burns’ childhood teddy bear that features in the episode “Rosebud” of The Simpsons.
References
Cugola, G., & Margara, A. (2012). Processing flows of information: From data stream to complex event processing. ACM Computing Surveys (CSUR), 44(3), 15.