Data-Flow Programming

SAP Sybase Event Stream Processor uses data-flow programming for processing event streams.

In data-flow programming, you define a set of event streams and the connections between them, and apply operations to the data as it flows from sources to outputs.

Data-flow programming breaks a potentially complex computation into a sequence of operations with data flowing from one operation to the next. This technique also provides scalability and potential parallelization, since each operation is event driven and independently applied. Each operation processes an event only when it is received from another operation. No other coordination is needed between operations.

The sample project shown in the figure shows a simple example of this.

Each of the continuous queries in this simple example—the VWAP aggregate, the IndividualPositions join object, and the ValueByBook aggregate—is a type of derived stream, as its schema is derived from other inputs in the diagram, rather than originating directly from external sources. You can create derived streams in a diagram using the simple query elements provided in the Studio Visual editor, or by defining your own explicitly.

Data-Flow Programming - Simple Example
Portfolio Valuation Sample Diagram
Data-Flow Diagram Contents
Element Description
PriceFeed
PriceFeed input window iconic
Represents an input window, where incoming data from an external source complies with a schema consisting of five columns, similar to a database table with columns. The difference is that in ESP, the streaming data is not stored in a database.
Positions
Positions input window iconic
Another input window, with data from a different external source. Both Positions and PriceFeed are included as windows, rather than streams, so that the data can be aggregated.
VWAP
VWAP aggregate iconic
Represents a simple continuous query that performs an aggregation, similar to a SQL Select statement with a GROUP BY clause.
IndividualPositions
IndividualPositions Join object iconic
Represents a simple continuous query that performs a join of Positions and VWAP, similar to a SQL FROM clause that produces a join.
ValueByBook
ValueByBook aggregate iconic
Another simple query that aggregates data from the stream Individual Positions.
Related concepts
Diagrams
The Sample Project