> For the complete documentation index, see [llms.txt](https://docs.deltastream.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.deltastream.io/how-do-i.../database.md).

# Use Namespacing for Organizing Data

Much like relational databases, DeltaStream uses [Database](/overview/core-concepts/databases.md)s and namespaces for logically organizing data, regardless of the [Data Store](/overview/core-concepts/store.md) in which the data resides.

You can use this logical separation to namespace [Query](/overview/core-concepts/queries.md) 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.

All DeltaStream objects are hosted in a database and namespace. Here's how to use this framework to organize your data:

## Create a Database

In addition to [Create Data Stores for Streaming Data](/how-do-i.../create-and-manage-data-stores/store.md), you must also create a database to process data. To do this:

1. In the lefthand navigation, click **Workspace** ( ![](/files/ZXcAkgugP7AuG9QFRXKO) ). Then, to the right of **Database**, click **+**, and then **Database**.<br>

   <figure><img src="/files/Iu40cekopLEIqkTfeb2A" alt="" width="344"><figcaption><p>Adding a Database</p></figcaption></figure>
2. At the prompt, enter a unique name for the database and then click **Add**.

The new database displays in the **Database** list of available databases.

## Using Database Namespaces

You can use namespaces to further organize objects 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.

1. Aggregate the page visits for each user and write that into a `my-db.analytics.user_visits` stream:

<figure><img src="/files/wUYJ7srAxA4odTwra6lB" alt="" width="563"><figcaption><p>Aggregating Page Visits as a Stream</p></figcaption></figure>

2. 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’ [Database](/overview/core-concepts/databases.md#_changelog) object to get the location information.
3. Write this into the analytics team’s public namespace in the `analytics-db`, `analytics-ds.public.user_visit_location`:

<figure><img src="/files/GiPi3w26Dc5q9XVx9nCP" alt="" width="563"><figcaption><p>Writing User Location Results</p></figcaption></figure>

## Reducing Clutter and Taming the Chaos

Using databases and namespaces, you can reduce clutter in the `analytics-db` . To do this:

1. Refine the necessary data in the `my-db` database.
2. Use the refinement to push an enriched set of records to the `public` namespace of the `analytics-db`.

{% hint style="success" %}
**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.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.deltastream.io/how-do-i.../database.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
