# 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://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FHAzhpgvH49fZ0SCYAZC3%2F01-sample-data-model.PNG?alt=media\&token=5d9d66c3-f5e5-4d97-b977-550c9ec70570)

### Toolbar

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

![02-data-model-toolbar](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2Ferq7TQHJRrsI9XBHJbAp%2F02-data-model-toolbar.PNG?alt=media\&token=443b5fb7-0350-4521-8029-6897c77b29e3)

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

*Undo*: Allows you to undo an action that you’ve performed on the data modeler.

*Redo*: Allows you to redo an action that you’ve negated through the *Undo* option.

*Auto Layout Diagram*: Arranges the entities in a model to improve its visual representation.

*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.

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

![03-data-model-aliases](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FFHtY6vLldSIF58ApUu1O%2F03-data-model-aliases.PNG?alt=media\&token=178ccd4c-66f0-4526-b982-7f0519e74b74)

*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*.

![04-view-data-types](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FyPKU1ALlXS6IL0eZN16H%2F04-view-data-types.PNG?alt=media\&token=a60871ff-f814-4b70-bca4-d1d36b3db629)

*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.

![05-view-entity-and-all-elements](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FpXyd7UmXKWPUgQTgHK2b%2F05-view-entity-and-all-elements.PNG?alt=media\&token=7df588ab-7737-45d6-938c-ee769a08f4c0)

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

![06-view-entity-and-keys](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2Fo2Tt4RYufbm1Ybd2SqGb%2F06-view-entity-and-keys.PNG?alt=media\&token=d56796e1-d7ef-45fd-9a55-a67bd73d4c7f)

*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/astera-data-stack-v10/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/astera-data-stack-v10/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/astera-data-stack-v10/data-model/creating-and-editing-relationships#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/astera-data-stack-v10/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.

![07-database-connection](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FMVcV9t5sUIX8Ro0x92p9%2F07-database-connection.PNG?alt=media\&token=3f190661-6934-4a4c-a492-d466b108006d)

*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/astera-data-stack-v10/data-model/data-models/reverse-engineering-an-existing-database).

*Generate DDL Script*: Allows you to create a DDL script from a data model. This option is also called *Forward Engineering*.

### Toolbox

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

![08-data-model-toolbox](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FkjNsnXDP1UsdSJGHQ1RP%2F08-data-model-toolbox.PNG?alt=media\&token=d7c049b5-915f-4646-92ee-6510213c2198)

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/astera-data-stack-v10/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/astera-data-stack-v10/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.

![09-data-model-browser](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2F2eFXUwtMBs1VvyUm6alr%2F09-data-model-browser.PNG?alt=media\&token=0a085e9c-e03e-44e6-b057-2aacb967c515)

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

![10-data-model-browser-entity-elements](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FWfzNjWDueml764PmXVHk%2F10-data-model-browser-entity-elements.PNG?alt=media\&token=c683f344-e33d-4c9d-8fd7-56c2d10e1f28)

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

![11-data-model-browser-context-menu](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FSZ77gTOIXUXRfZSwkvte%2F11-data-model-browser-context-menu.PNG?alt=media\&token=0f563543-989f-499e-a3de-3a4d50d9ee57)

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.

![12-entity-context-menu](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FqvxBjM2OQ1wQFVKt08vk%2F12-entity-context-menu.PNG?alt=media\&token=871d4421-48db-47df-9ec1-34441a6173f0)

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

![14-data-model-browser-options](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FKNloQNMoZ5aRE2GIO0Y8%2F14-data-model-browser-options.png?alt=media\&token=ec8c6e85-d762-48ab-b6e9-d9a694d81f85)

*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 be one node, *General*, if this option is selected.

*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.

![15-data-model-views](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FRibGEaHSsESpqCZ3GBMC%2F15-data-model-views.PNG?alt=media\&token=e1271027-c876-4fe8-a83b-e3ac1efa80d7)

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.

![19-view-data-model](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FAsQDh0HiQI4NG131yhHC%2F19-view-data-model.gif?alt=media\&token=9ef3da38-3f7d-48bf-acb6-ec37030f62bb)

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

![20-data-model-context-menu](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FI8xWHakoTen3RDJ8Rqhe%2F20-data-model-context-menu.PNG?alt=media\&token=28ba96d2-3e77-432e-9ecb-477d3d23284c)

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

![16-add-entities-new-view](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FvMOpOwAJ88RC01RdL4d7%2F16-add-entities-new-view.PNG?alt=media\&token=c7d299b2-6656-48f7-b32d-c37b778dd751)

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

![17-add-new-entities-new-view](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FpGotZpBa0fpXWSkm839X%2F17-add-new-entities-new-view.PNG?alt=media\&token=1b187d43-7762-4429-854b-a33a3095074d)

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

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

![18-data-model-new-view](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FUbZFoZoVJZRI4ELsNDUa%2F18-data-model-new-view.PNG?alt=media\&token=61293c92-ec40-4eb5-b15c-765a9a9f44d8)

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>
