Streams

Data streams are the basic components for transmitting data within Sybase CEP. CCL queries take data from streams arriving in the Sybase CEP Server, process the data according to the CCL queries, and insert the results into other streams.

SQL users may find it convenient to think of data streams as being similar to database tables. Like tables, data in streams are formatted in rows and columns. Each data stream has an associated schema, which defines the stream's columns and each column's datatype. Whenever a data stream receives data, it appears in the form of a row, with a value for each of the columns represented in the schema.

Just like SQL, the value in a column may be NULL, meaning that the value in that column is unknown or nonexistent.

Note:

SQL table schemas usually must specify whether columns in a table may store NULL data. This is not the case in CCL. Every column in every Sybase CEP data stream may contain NULLs.



Despite these similarities to SQL tables, there are also important differences. SQL tables are finite-sized sets of rows, while data streams are stateless streams of data. Typically, a row that passes through a data stream in a query is available to be processed only at the precise moment in time when it appears in the stream. Once an incoming row has been processed, it is normally no longer available to a query. However, CCL does have several ways of either temporarily or permanently maintaining the state of rows that have already flowed through a stream.

Illustrating Data Streams in the Programmer's Guide

A number of figures in this manual illustrate the way data flows through a CCL query. It is extremely difficult to graphically visualize this process (which, by nature, involves data changing as time passes) using a static picture.

Figures that depict stream data flowing through queries show the input streams above or to the left of the query and the output streams below or to the right, with the rows in the streams shown flowing from the left side of the page to the right. The data in each row is arranged vertically, with the timestamp at the top.

The earliest rows (those with the oldest timestamps) that passed through the query will be on the right of the streams and the most recent rows (those with the newest timestamps) will be on the left. The same data rows will be shown in both input and output streams and timestamps will be shown for all rows to illustrate when each row arrived in the stream.

Sybase CEP timestamps normally include both a date and time resolved to the microsecond ("2006/11/01 09:45:13.000099" ). To save space in the illustrations, all timestamps will be shown without the date and with time resolution expressed only to the second ("09:45:13"). Rows that arrive second by second provide sufficient granularity for the examples in this manual. Please remember that Sybase CEP is capable of processing data at much higher rates (many thousands of rows per second). When rows are processed at that speed, timestamps need to be stored and viewed at the most precise resolution.


Created March 8, 2010. Send feedback on this help topic to Sybase Technical Publications: pubs@sybase.com