According to the EPTS Glossary (Event Processing Technical Society), event processing is defined as follows: “Computing that performs operations on complex events, including reading, creating, transforming, abstracting, or discarding them. Note: CEP ultimately creates complex events even if some or all of the source events are simple events.” In this post, I suggest exploring the complex event concept from a data architect point of view. Even if Complex Event Processing (CEP) is a really interesting scope, this is not what we will explore. In this post, I will give you a personal point of view on the structure of a complex event. Note: be careful, what you will read is not absolute truth, only my opinion on the matter.
What is an event?
We give a general definition of an event in a post talking about master data management, here we will go deeper in its definition. Again, according to the EPTS Glossary, an event is “an object that represents, encodes, or records an event, generally for the purpose of computer processing. For Example:
- A purchase order (records a purchase activity)
- An email confirmation of an airline reservation
- Stock tick message that reports a stock trade
- A message that reports an RFID sensor reading
- A medical insurance claim document“
This definition does not match to what I’m talking about because it defines an information carrier, not the information itself. For example, if a document describes a medical insurance claim, it means the event is the document, not the medical insurance claim. If the medical insurance claim is also recorded in a database, then what does it mean? Are they two different events or duplicates ?
So, I prefer to use the Cambridge dictionary, which gives a definition that best fits what I call an event: “Anything that happens, especially something important or unusual.” and I will even get rid of that part qualifying the importance of an event, so we’re only left with: “Anything that happens”.
To go further, we can have a look at the definition of the term “happen“: “(of a situation or an event) to have existence or come into existence“. With that, it is perfect for the rest of this post.
What is the difference between an event and a complex event?
What is a complex event?
We are now in an IT context, so we will define IT concepts. Unfortunately, the Cambridge dictionary will not help us with this step. That’s why I will use the EPTS Glossary which describes a complex event as follows: “An event that summarizes, represents, or denotes a set of other events. For Example:
- The 1929 stock market crash – an abstraction denoting many thousands of member events, including individual stock trades)
- A completed stock purchase –an abstraction of the events in a transaction to purchase the stock
- The 2004 Indonesian Tsunami – an abstraction of many natural events
- A successful on-line shopping cart checkout – an abstraction of shopping cart events on an on-line website
This definition matches what I’m talking about, but there is an issue with the examples given, and also with the fact it qualifies a complex event as an event itself.
Difference between an event and an event instance
Firstly, about the examples, when they talk about THE 1929 stock market crash, they are talking about an instance of a market crash, a particular event. However, when they talk about A successful on-line shopping cart checkout, they are talking about something that can happen multiple times. So where is the event ?
In my opinion, we shouldn’t consider events and instances of an event as the same concept. I prefer to describe these two concepts as follows:
- Event: anything that happens (for example “THE 1929 stock market crash“)
- Event type: an event type allows to normalize events (for example “market crash”)
Simple event introduction
Secondly, about the definition qualifying a complex event as an event itself. I agree with that, but if an event is not a complex event, then what is it ? I suggest calling it a simple event with the following definition: “A simple event is an event that happens in an instant, as such, it cannot be a set of other events. It is an atomic description.”
Event structure and complex event example
Complex event example
We have enough information to define the structure but we still need some characteristics. To get it, we will use an example:
- Take a pen in your hand
- Put your hand over a table
- Release the pen
- I’m sure the pen fell on the table
We can extract the following simple events from this example:
- The hand takes an object
- The hand releases the object
- The object crosses a point between the hand and the table
- The object touches the table
And now, the complex events begin to appear:
- “Put your hand over a table” is composed of the following simple events:
- Firstly, The hand starts to move
- Secondly, The hand crosses a point in space
- Thirdly, The hand stops moving
- “Pen fall” is composed of the following simple events:
- The hand releases the object
- The object crosses a point between the hand and the table
- The object touches the table
Finally, if you remember the complex definition “An event that summarizes, represents, or denotes a set of other events“. There is a last complex event that we can identify, which represents the “complete example”.
Event Structure
To conclude, that’s what this schema shows:
- An event is anything that happens, it is described by an event type
- An event type allows to normalize events
- A simple event is an event that happens in an instant, it is described by a type (because it is an event), a date which records the instant and the list of involved objects.
- A complex event is an event that denotes a set of other events. As such, a complex event is described by a type (because it is an event) and composed of events (simple or complex).
Now, we can represent our example data like this. In this example, we imagine that you try the experience twice with two different pens:
That’s a good start, we will probably write other posts on this subject to explore special cases.
3 thoughts on “What Is a Complex Event?”