Events can be processed on Realtime using Siddhi CEP engine. Sequence of events having the same type are defined as a stream and processing by Siddhi using SQL like Siddhi Query Language (SiddhiQL), Siddhi works as an upside down database by storing all the queries in memory, matching incoming events against the stored the queries at runtime and producing matched events as streams.
In-order to process events the execution logic should be written as a script using SiddhiQL and deployed in the server. This Execution Plan will act as an isolated execution environment and there will be an instance of Siddhi Execution Runtime created for each Execution Plan. An Execution Plan can import one or more streams from the server for processing and push zero or more output streams back to the server. In-order to import and export streams the script will also contain import and export annotations bindings the streams on the server with the streams defined in the Execution Plan.