Why CEP is so difficult?
I was asked a time ago why CEP (Complex Event Processing) is so difficult?
Or rather, why is it so hard to build your own generic and functionally complete CEP server?
I think one of the answers is that you need to do two conflicting things:
- Process events in memory only
- Store events and state in persistent storage
You need to do 1. because of your need for speed.
You need to do 2. in order to build a reliable and predictable system.
The magic blend of these two are required for most CEP systems. It’s here where you need better than average architects and developers to produce anything usable.
Example – Why..
Just a simple example to understand why you need both. Say you are looking for a sequence of events:
A,B,C,D,E
You expect this sequence to occur during a seven day period. When you see event A, you start looking for the rest of the events.
Lets say you saw events B and C after a couple of days. Then the server is re-booted suddenly, just quickly, but your system is killed unexpecedly.
When your event processor is brought back online again you need to remember that you have seen A, B and C and are looking for the next event in the sequence which is D.
This forces you to save state information in some kind of persistent storage (database). If you are looking for thousands and thousands of long event sequences you will quickly get really bad performance if you keep writing state information to the database constantly.
When You Don’t Need Persistence
There’s a special type of event processing where you don’t need persistent storage
A class of CEP solutions where the problems can best be described as data driven algorithms do rarely require persistence. Tools like Coral8/Aleri, Esper, StreamBase are commonly used to do this kind of processing. This type of processing, commonly done using some kind of extension to the SQL concept. Typical uses that I have seen have mostly simple queries which constantly produce output. If there are patterns in the queries they tend to be simple and short lived.
If you only need this kind of state-less processing then you can get really high performance instead of systems like ruleCore where the persistence is a fundamental concept and can’t really be switched off.
If you are shopping for a complete event processing platform you should at least evaluate everything with full persistence switched on. Provided that the CEP system provides real usable persistence, not all do…
Recent Comments