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 define relations for an entity, it becomes available to DeltaStream as a consumable entity. For example, you can use them in interactive queries:
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 for it:
Since the ds_users entity hosts user information that changes over time, you can define a to capture ongoing changes to each userid:
Note For certain applications, it may be more useful to have access to a snapshot of the resulting data. See and CREATE MATERIALIZED VIEW AS for more information on how to create a view for the data.