Data streams are the fundamental way in which data is transmitted throughout Sybase CEP. CCL queries take data from data streams, process that data, and send it to other streams. While data streams are similar to database tables, database tables are comparatively static while the data flow in a stream is ongoing and continuous.
Data streams may be accessed by more than one query. A data stream may be used as a data source for multiple queries, and it may also be used simultaneously as a data source for some queries and a destination for other queries.
Data streams alone do not retain any state. Therefore, only the most recent row in a data stream is "visible" to the queries with which it is interacting, and that row is only visible at the moment when it appears in the stream. If an arriving row is not either consumed immediately by the query or retained in some way, it cannot be accessed later. Fortunately, Sybase CEP has several ways of retaining the state of rows that have entered via a stream, which are explained later in this chapter.