# Data Modeler - UI Walkthrough

Astera Data Stack contains a built-in data modeler that you can use to create a data model from scratch or by reverse engineering an existing database. In this article, we will cover a detailed overview of the data modeler’s user interface.

### Video

{% embed url="<https://youtu.be/9eoYQwlOjks>" %}

### Overview

Let’s assume that we’ve created this data model by reverse engineering an existing database:

![01-sample-data-model](https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2FDpfCIL9Axobz21WYghXC%2F01-sample-data-model.png?alt=media\&token=f183ed1f-4534-4c8a-a6b6-f04548084b14)

### Toolbar

The data modeler contains a dedicated toolbar that provides an extensive list of options.

![02-data-model-toolbar](https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2FlnfPJ3mkK7ZWAoi38ZQX%2Ftoolbar.png?alt=media\&token=247c265f-7963-4683-9e5e-0fbf223bffd3)

You will find the following options or shortcut icons on the toolbar, from left to right.

*Zoom*: A dropdown menu that allows you to zoom in or out of a model.

*Auto-Size All*: Adjusts the size of each entity object.

*View at an Entity Level*: Reverts to the default setting of displaying only entity names on the data modeler.

*View Entity and all Elements*: Displays all of the elements or fields in each entity present in the model.

<figure><img src="https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2F4NLnJGm3jP5R0mvOsEbO%2F02-view-entity-and-all-elements.png?alt=media&#x26;token=64f2a20a-9891-42bc-810c-1fd367705359" alt="" width="560"><figcaption><p>03-view-entity-and-all-elements</p></figcaption></figure>

*View Entity and Keys*: Displays all of the primary and foreign keys in each entity present in the model.

<figure><img src="https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2Fbp8nmI2Nk3QFJQvCIOot%2F03-view-entity-and-keys.png?alt=media&#x26;token=99feccd2-3afe-43b2-acd3-5dbaaca289b6" alt="" width="563"><figcaption><p>04-view-entity-and-keys</p></figcaption></figure>

*Show or Hide Items*: Displays only the selected entities in the model.

<figure><img src="https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2F5seTu49B5IV2t2Vy4adP%2F05-show-or-hide-items.png?alt=media&#x26;token=5d27b023-2dc3-4db9-9385-7bcf5bf7bb04" alt=""><figcaption><p>05-show-or-hide-items</p></figcaption></figure>

*Show Alias Labels*: Displays the parent and child alias on each relationship link in the model.

![06-data-model-aliases](https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2FUZL06bDtGzi0Qw5LdyvW%2F06-data-model-aliases.png?alt=media\&token=ce5350de-da1d-424b-8aeb-e33649585fd4)

*Show Verb Labels*: Displays the parent-to-child and child-to-parent verbs, if assigned by the user, on the relationship link. You can assign these verbs to each relationship via the *Edit Relationship* window.

*Show Data Types*: Displays the data types of each field in an entity. This option is only applicable if one of the following options has already been selected: *View Entity and all Elements* or *View Entity and Keys*.

![07-view-data-types](https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2FgIC5A89UsePMZ3plCYJD%2F07-view-data-types.png?alt=media\&token=7cfe9528-3dec-4f0d-aded-f14325605c84)

*Add Self Reference*: Allows you to create a self-reference relationship within an entity. To learn more about how you can use this option, click [here](https://documentation.astera.com/data-model/creating-and-editing-relationships#self-reference).

*Link entities to create non-identifying relationships*: Allows you to create non-identifying relationships between entities. To learn more about how you can use this option, click[ here](https://documentation.astera.com/data-model/creating-and-editing-relationships#non-identifying).

*Link entities to create identifying relationships*: Allows you to create identifying relationships between entities. To learn more about how you can use this option, click [here](https://documentation.astera.com/data-model/creating-and-editing-relationships#identifying).

*Manage all relationships in data model*: Allows you to manually mark relationships as identifying or non-identifying.

*Pointer*: Reverts back to the default pointer in case you had selected one of the options used to link entities and create relationships.

*Infer Relationships from Field Names*: Automatically assumes and creates relationships based on common field names between entities.

*Denormalize Entities*: Enables you to denormalize or combine two entities in the model.

*Deploy Data Model*: Enables you to deploy a data model. For more information on deploying a data model, click [here](https://documentation.astera.com/data-model/deployment-and-usage/deploying-a-data-model).

*Change Database Connection Info*: Allows you to change the database connection of the model via a *Database Connection* window.

![08-database-connection](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/pQXMDzWa7xkc4EKmSn1u/07-database-connection.PNG)

*Bulk Operations*: *Allows you to perform actions on multiple data model entities at once, such as filtering or updating attributes.*

<figure><img src="https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2FVNf8vQ8Mbr6sneYgJE97%2F08-bulk-operations.png?alt=media&#x26;token=61356567-8c3e-4ab0-bcbf-12eee27aea28" alt="" width="563"><figcaption><p>09-bulk-operations</p></figcaption></figure>

*Reverse engineer an existing database*: Allows you to create a data model by reverse engineering an existing database. To learn more about the process of reverse engineering, click [here](https://documentation.astera.com/data-model/data-models/reverse-engineering-an-existing-database).

*Forward Engineer an existing database*: Allows you to create a DDL script from a data model.

*Povider*: Select the database provider to connect to your data source (e.g., SQL Server, PostgreSQL, Snowflake).

### Toolbox

The toolbox includes a few objects which can be used as part of a model.

![10-data-model-toolbox](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/0YjWtrIyRkPYqqm4CMsW/08-data-model-toolbox.PNG)

You can drag and drop any of these objects onto the data modeler.

*Annotation*: Provides a textbox for you to add a comment on the model.

*Date Dimension*: A non-editable date dimension entity that can be used as part of a dimensional model.

*Entity*: An editable general entity that can be added to an existing data model or used to create a data model from scratch. To learn about general entities, click [here](https://documentation.astera.com/data-model/data-models/general-entity-properties).

Time Dimension: A non-editable time dimension entity that can be used as part of a dimensional model. For more information on date and time dimensions, click [here](https://documentation.astera.com/data-model/dimensional-modelling/date-and-time-dimension).

### Data Model Browser

The data model browser provides a single window for you to edit the data model and its components without having to look through the entire model and access the entities directly.

![11-data-model-browser](https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2FVtrGC7ibWp7Yjc3WxGSp%2F11-data-model-browser.png?alt=media\&token=a25e3efc-b577-43f5-b8ec-df0c56fb3dc2)

You can expand each entity to view the elements contained in it.

![12-data-model-browser-entity-elements](https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2FCKFagGf6RxEcMv5GhMOk%2F12-data-model-browser-entity-elements.png?alt=media\&token=cb185f85-18fe-4c78-9a2a-f6608a73e79a)

Moreover, you can right-click on an entity name and choose to go to the actual item in the data model.

![13-data-model-browser-context-menu](https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2F4sZNVI3K6yHEdLuxvneu%2F13-data-model-browser-context-menu.png?alt=media\&token=67c197f4-f334-4970-990e-00e346aee63a)

The other options available in the context menu are the same as those that appear when you right-click on an entity in the data model.

![14-entity-context-menu](https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2FJOgGoVyq4XuUuV2TI8cR%2F14-entity-context-menu.png?alt=media\&token=08bd9eb0-2d5a-4294-8ec5-37d1e3221a42)

At the very top of the data model browser, a few options/icons are available.

![15-data-model-browser-options](https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2FjaAk2qfPvbZrg94kDRpX%2F15-data-model-browser-options.png?alt=media\&token=71c5f8d8-540f-48ca-8e35-ceeed5c791f7)

*Sort Entities Alphabetically*: Sorts the entity names in an alphabetical order. This option is selected by default.

*Group Entities by Type*: Creates separate nodes for each entity type. In this case, there’s only going to be one node, *General*, if this option is selected.

*Group Entities by Schema*: Organizes entities under nodes based on their database schema (e.g., dbo, sales).

*Expand All*: Expands all of the nodes in the data model browser.

*Collapse All*: Collapses all of the nodes in the data model browser.

*Delete this object from the data model*: Deletes the selected object from the data model.

You can use the search bar underneath these options to search for any specific entity or field in the model.

### Views

At the bottom of the data modeler, you’ll notice a tab titled *Main* and an icon that represents the *Add New View* option.

![16-data-model-views](https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2FwTQpA4TmI7sZR6CMdP1F%2F16-data-model-views.png?alt=media\&token=00eea7d2-6ccc-4e68-ab1f-ea63cee49752)

The *Main* tab contains a view of the complete data model. If you wish to add a new view consisting of a few specified entities, click on the *Add New View* icon. A blank designer will appear on the screen. Here, you can create a new view by adding entities from the existing model, which can be done in two ways.

1. &#x20;Drag and drop the entities of your choice from the data model browser.

![17-view-data-model](https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2Fr8hLi0XxMnfYE3yNkVjS%2F16-view-data-model.gif?alt=media\&token=b6728e4a-235c-4a27-94b2-1e397f08197d)

2. &#x20;Right-click on the designer and select *Add Existing Entities* from the context menu.

![18-data-model-context-menu](https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2FdLR0So6QSRZiWpklpZaX%2F17-data-model-context-menu.png?alt=media\&token=67925685-81c1-4115-ba10-944d5e70fe48)

The following pop-up window will appear on the screen:

![19-add-entities-new-view](https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2FlJ0Q1sEO0gDf8POMsiLR%2F19-add-new-entities-new-view.png?alt=media\&token=4d2b0ca6-7277-40c3-b4f3-74882b504a68)

Here, you can select the entities you want to include in the new view. In this case, we’ll select *People*, *Invoices*, and *InvoiceLines*.

![20-add-new-entities-new-view](https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2FICXGqSadT6cntDfeJqLG%2F19-add-new-entities-new-view.png?alt=media\&token=208bee9d-13aa-40a7-bdf1-1a1deb85a212)

Once you’re done selecting the entities, click *OK*.

A new view consisting of the selected entities will appear on the screen.

![21-data-model-new-view](https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2Fx2e05JcZg9Hd9c4aTjvs%2F20-data-model-new-view.png?alt=media\&token=7bd673be-951a-401d-87ec-33b6a6a57482)

Using the tabs at the bottom, you can switch between different views of the same model.

This concludes our walkthrough of the data modeler’s user interface.

<br>
