In DeltaStream a Store provides a layer of abstraction around the raw streaming data. To process that data in queries, we must make sense of the data. To this end, we use relations for defining the metadata and data format that in turn describe the structure of the data for its native format.
Understanding the Data
As an example, below is a defined Apache Kafka store that contains several entities:
Now assume all entities are in JSON format. See CREATE STORE and UPDATE ENTITY for using other serialization formats. For information around data formats -- for example, CREATE STREAM -- refer to the relation’s DDL statements.
You can inspect the entities to understand the kind of data you have -- for example the ds_pageviews entity:
When you know what the data looks like in your entities, you can attach a structure to them for reference in queries. In the example below, as ds_pageviews is a continuous stream of immutable page events from your users, you can define a Stream for it:
Note For certain applications, it may be more useful to have access to a snapshot of the resulting data. See Materialized View and CREATE MATERIALIZED VIEW AS for more information on how to create a view for the data.
When you have defined relations, you can list them through their database and schema:
When you define relations for an entity, it becomes available to DeltaStream as a consumable entity. For example, you can use them in interactive queries: