The Wayback Machine - https://web.archive.org/web/20100619150916/http://java.sys-con.com:80/node/1433413

Welcome!

Java Authors: Maureen O'Gara, Liz McMillan, Dmitry Paramzin, Elizabeth White, Pieter Humphrey

Related Topics: SOA & WOA, Java, .NET

SOA & WOA: Article

A Simple Approach to Complex Event Processing

Modern IT suggests a handful of practical applications for real-time event processing

What is an event? Generally speaking, an event is an occurrence that brings about significant change in the state of an object from a certain point of view. For example, the "sunrise" is an event that is defined from the perspective of an earthling. Yet from the perspective of an alien, Earth's sunrise is not a sunrise at all, but merely a lonely planet's celestial rotation. On a simple scale, we can view the change of time as an event in itself. Consider a sun dial's interpretation of time. While a sun dial doesn't move, the forces of time act upon the object, thus causing an event.

The former describes simple events, or a singular event defined from the perspective of its onlooker, whereas complex events are the product of an onlooker's interpretation of a series of events. The same event can be defined as either "complex" or "simple" depending on its context. For example, the Siberian spring can be distinguished as a simple event if one learns of it from a newspaper. The same event would be considered complex if taken from the perspective of a Siberian wolf that does not read newspapers, but acknowledges spring's arrival due to a number of sub-events, such as rising air temperatures, thawing snow, and leaves appearing on the trees.

Event-Driven Systems
Roughly speaking, an event-driven system is something that changes its state in response to particular events. As such, every object can be considered an event-driven system. For example, a flower reacts to a sunrise by opening its blossom and water boils when its temperature reaches 100°C at standard pressure at sea level.

Programmers have successfully applied this event-driven approach for many years to build artificial event-driven systems that provide scalability, reliability and adaptive behavior. Figure 1 provides a visual representation of how event-driven system (EDS) can be organized.

Figure 1: Simple EDS architecture

First, the sensors detect occurrences of events, form an event stream, and then deliver that stream to the atomic events dispatcher. Next, the dispatcher feeds these events to the appropriate business activity.

Figure 2: Extended EDS Architecture

The application of Figure 1 can be made more complex by adding an events preprocessing unit to recognize significant patterns of indivisible events coming from the sensors. Once a pattern is recognized, the new "complex" event will be delivered to the event dispatching logic as shown in Figure 1. As we can see, CEP may be seen to be a generalization of Simple Event Processing (SEP).

Complex Task Solving
The product of an event processing sequence can be treated as a solution for a particular task. The task can be a forecast, a system troubleshooting activity, or an enterprise business management decision. Once a solution is found, it typically serves as the basis for future business-related activities.

Let's define "decision" as a specific outcome of the event processing cycle that turns into the basis for further business activity. This basis can be represented as the recommendation produced by the Event Processing Unit (see Figure 2). As such, the term "decision making" became generally associated with the concept of event processing. Continuing this generalization, we notice that a decision-making process should consider factual data. For example, a bartender recognizes a specific customer (event), considers historical preferences of the customer and/or the local inhabitants, and then makes a decision to offer a drink based on such information. Most important, a decision-making algorithm can use long-term memory to chronicle input events, along with its own decisions and feedback, then utilizes this data to produce improved outputs in the future.

Figure 3: SEQ Diagram: Full-fledged DDS architecture

As we can see, decision-making is quite a complicated process; it considers a wide range of data and is not confined only to events per se. Event processing is a function that uses input data (not only events) to produce outputs (decisions that are the basis for future business activities). Generally speaking, the implementation of this function becomes the task for the artificial intelligence (AI). I don't intend to discuss AI theory since it's beyond the scope of this article. Nevertheless, let's consider the basic approaches.

Neural Network Simulation
In general, a neural network [2] can be tuned to generate desired outputs ("decisions" in our case) according to particular inputs. The greatest shortcoming of this approach is that artificial neural nets usually require a long learning cycle and a fine adjustment before they can be applied to real-world scenarios. Neural nets can be useful in situations where we have a large amount of statistical data that contains sets of real-world causes with corresponding empirical consequences. In these cases it's hard to build a strict mathematical function or find a deduction sequence that will be able to predict consequences of certain factors. An example of such a task is stock market forecasts [5] that utilize neural networks to examine a plethora of historical data to predict the effect that recent occurrences will have on a stock's future value.

Deduction Rules
In certain cases we can compose a sequence of deductive reasoning by linking input data with corresponding outputs, or consequences. We can represent this logic as the formal deduction rules that are "understandable" by a computer. In contrast to neural networks, using deduction rules does not require long learning cycles. Nevertheless, it does require the presence of an expert in a related field to compose appropriate collection rules and determine data sources. For example, software developers need to consult with a business analyst to create a system that optimally controls business processes inside of a corporation.

Implementation Overview
Modern IT suggests a handful of practical applications for real-time event processing. The most notable include the application of enterprise management automation, market data analysis and network monitoring. Each of these environments usually provides some proprietary language that enables a clear description of an event processing flow. For instance, Oracle CEP application server [7] uses Oracle Continuous Query Language for event streams processing [4], the StreamBase server manages event streams using StreamSQL and Coral8 uses Continuous Computation Language.

All of the above mentioned languages are SQL-based. They represent event streams as the tables of relational databases that continuously update content. Another approach is provided by the imperative-based Apama's MonitorScript. For those who don't want to touch textual programming, the market also provides a number of visual tools such as Alery Streaming Platform [1] or StreamBase Studio.

References

  1. Alery streaming platform
  2. Artifical Neural Network overview
  3. Complex Event processing overview
  4. Event Stream Processing overview
  5. Golden Gem prediction program
  6. KNOL explanation on CEP
  7. Oracle CEP engine

More Stories By Dmitry Paramzin

Dmitry Paramzin is a Senior Software Engineer at Axmor Software, a software development company located in Novosibirsk, Russia. He has over 9 years of experience in software development and holds an Engineering degree in Computer Science. During the last few years of working in Axmor’s IBM Solutions Group, he has acted as a Technical Lead and Software Architect in several large-scale enterprise projects.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


'); var i; document.write(''); } // -->
 

About JAVA Developer's Journal
Java Developer's Journal presents insight, technical explanations and new ideas related to Java and covers the technology that affects Java developers and their companies.

ADD THIS FEED TO YOUR ONLINE NEWS READER Add to Google My Yahoo! My MSN