Namespacing with Database and Schema
Last updated
Last updated
Much like relational databases, DeltaStream uses Databases and s for logically organizing data, regardless of the Store in which the data resides.
You can use this logical separation to namespace Query statements based on the scope of the query and what stores are involved. This is of particular value when your stores are accessible by more than one team and you require collaboration on the data.
In DeltaStream, all s are hosted in a database and schema. This tutorial demonstrates how to use this framework to organize your data.
In addition to Creating Stores for Streaming Data, you must also create a database to process data. To do this:
In the lefthand navigation, click Resources ( ). Then, to the right of Catalog, click +, and then Database.
At the prompt, enter a unique name for the database and then click Add.
The new database displays in the Catalog list of available databases.
You can use schemas to further organize relations within a database. This makes it possible to manage complex projects.
Here's an example: refining your pageviews
events before you share them with your business analytics team for further analysis.
Aggregate the page visits for each user and write that into a my-db.analytics.user_visits
stream:
Write this into the analytics team’s public schema in the analytics-db
, analytics-ds.public.user_visit_location
:
Using databases and schemas, you can reduce clutter in the analytics-db
. To do this:
Refine the necessary data in the my-db
database.
Use the refinement to push an enriched set of records to the public
schema of the analytics-db
.
Tip This namespacing approach enables you to organize where to write data into and where it resides, while also ensuring the right consumer can access it across your company.
Use the new page_visits
stream and enrich it with the user’s latest location for a full picture on how your users are visiting pages on your website.
Here, you're using your users’ relation to get the location information.