Designing Logical Models

A logical model is an entity relationship diagram that accurately describes business rules based on entities and their relationships. The logical model must ensure the correctness and consistency of the data structure required by business, reflect the features of diverse objects based on a series of standard rules, and accurately define the relationships between entities. In addition, the logical model provides a powerful reference for constructing the physical model, which is an indispensable phase in the process of designing a database.

The following parts are included in this section:

Considerations in Logical Model Design

  • You must consider not only the current business status, but also the future business development.
  • Personnel who are familiar with the businesses must participate in the modeling. In this way, the business requirements can be fully integrated into the models.
  • High efficiency of transforming the logical model to the physical model must be ensured.
  • Take physical features into consideration in the physical modeling phase.
  • Each entity, attribute, and relationship must be consistent with the information in the actual business.

Creating a Logical Model

  1. Log in to the DGC console, select a DGC instance, and click Access.

    On the displayed page, click the Workspaces tab. In the workspace list, locate the required workspace.

  2. Click Data Design of the corresponding workspace to access the Data Design console.
  3. Choose ER Modeling from the left navigation bar.
  4. On the ER Modeling page, if no ER model has been created, the system displays a dialog box asking you to create one. If you have created ER models before, click to create new models. See the figure below.
    Figure 1 ER Modeling page
  5. In the displayed dialog box, set parameters as prompted and click OK.
    Figure 2 Creating a logical model
    Table 1 Parameters

    Parameter

    Description

    Name

    Only letters, digits, and underscores (_) are allowed.

    Description

    A description of the logical model.

Creating and Publishing a Logical Table

After creating a logical model, you can create a logical table.

  1. On the DGC Data Design console, choose ER Modeling from the left navigation bar.
  2. On the displayed page, select a logical model, expand it, and select a subdirectory. Then, click Create.
  3. On the Create Table page, set parameters as required.

    1. Set the basic parameters described in the figure below:
      Figure 3 Basic configurations of logical tables
      Table 2 Parameters

      Parameter

      Description

      Subject

      Click Select to select a subject.

      Name

      The name of the table to be created. Only letters, digits, and underscores (_) are allowed. Table names cannot start with digits.

      Code

      The code of the table to be created. Only letters, digits, underscores (_), $, {, and } are allowed. Table codes cannot start with digits.

      Parent Table

      Set a parent table.

      Tag

      Tags are custom identifiers that help users classify and search for data assets. After adding a tag, you can search for related data assets in the DGC Data Assets module with ease.

      Click to add a tag to the table. In the dialog box that is displayed, select one or more existing tags, or enter a new tag name and press Enter. You can also go to the Tag Management page of the DGC Data Assets module to add a tag. Then, return to this page and select the newly added tag from the tag drop-down list. See Tags.

      Owner

      Select an asset owner from the drop-down list. Only the workspace administrator or developer can be set as the owner.

      Description

      A description of the table to be created. Up to 200 characters are supported.

    2. Add required fields on the Table Fields tab page. See Table 3 for details.
      Figure 4 Adding a table field
      Table 3 Parameters of table fields

      Parameter

      Description

      Name

      Table names must start with letters. Only letters, digits, and underscores (_) are allowed.

      Code

      Table codes must start with letters. Only letters, digits, and underscores (_) are allowed.

      Data Type

      Field data type. If the required data type does not exist, you can add one. See Managing a Field Type.

      Data Standard

      If you have created data standards, click to select one to associate with the field. Choose Configuration Center > Function Configuration and select Create Quality Jobs. Associate fields with a data standard. After a table is published, a quality job is automatically generated. A quality rule is generated for each field associated with the data standard. The quality of the field is monitored based on the data standard. You can go to the Quality Job page of the DGC Data Quality Control to view the job details.

      If you click Associate with Data Standard above the field list and select a data standard that you want to associate the field with, a new table field associated with the selected data standard is automatically created. The default field name and code are the same as those of the associated data standard. You can change the field name and code if necessary.

      If you have not created a data standard, create one. See Data Standards for details.

      Primary Key

      If this parameter is selected, the field is a primary key.

      Partition

      If this parameter is selected, the field is a partition field.

      Not Null

      Whether the parameter value can be left empty.

      Tag

      Click to add a tag.

      • In the displayed dialog box, select one or more existing tags. If no tag has been added, you can go to the Tag Management page of the DGC Data Assets to add a tag. See Tags.
      • In the dialog box that is displayed, enter a new tag name and press Enter. Tag names can contain letters, digits, and underscores (_), but cannot start with underscores (_).

      Description

      A description of the field to be added.

    3. Click Create on the Relationships tab page to create a relationship.
      A relationship refers to the logical relationship between two entities. It describes how an entity is associated with another entity, or the impact of an entity's behavior on another entity. Relationships between entities in a data model are particularly important and must be accurately defined. Otherwise, the actual business rules cannot be accurately described in the data model, and data consistency is greatly damaged.
      Figure 5 Creating a relationship
      Table 4 Parameters

      Parameter

      Description

      Name

      Each relationship has a name to describe the function of the relationship.

      Child Table

      Click this field to select a table from the drop-down list. Click to set the current table as a child table.

      Child Table Field

      Select fields in the child table.

      Child to Table

      indicates that each piece of data in the child table corresponds to only one piece of data in the parent table.

      indicates that each piece of data in the child table corresponds to one piece of data at most in the parent table.

      indicates that one piece of data in the child table corresponds to multiple pieces of data in the parent table.

      indicates that each piece of data in the child table corresponds to at least one piece of data in the parent table.

      Parent to Child

      indicates that each piece of data in the parent table corresponds to only one piece of data in the child table.

      indicates that each piece of data in the parent table corresponds to one piece of data at most in the child table.

      indicates that one piece of data in the parent table corresponds to multiple pieces of data in the child table.

      indicates that one piece of data in the parent table corresponds to one piece of data in the child table at least.

      Parent Table

      Select a table that has a logical relationship with the selected child table.

      Table Field

      Select fields in the parent table.

      Role Name

      You can customize a role name to identify the relationship.

      Operation

      Click to delete a relationship. Click to edit the relationship.

  4. Click Publish, select a reviewer, and click Submit.

    Wait for the reviewer to approve the application. After the application is approved, return to the model list and view the created table in the list.

Converting a Logical Model to a Physical Model

After a logical model is created, you can convert it to a new physical model or an existing physical model.

  1. Log in to the DGC console, select a DGC instance, and click Access.

    On the displayed page, click the Workspaces tab. In the workspace list, locate the required workspace.

  2. Click Data Design of the corresponding workspace to access the Data Design console.
  3. Choose ER Modeling from the left navigation bar.
  4. Find the required logical model and click the conversion button on the model.
    Figure 6 Logical model conversion
  5. In the Convert to Physical Model dialog box, set the parameters in the following figure and click OK.
    Figure 7 Convert to Physical Model dialog box
    Table 5 Parameters

    Parameter

    Description

    Name

    The name of the physical model to be converted from a logical model. You can enter a new model name. The system creates the model. You can also select an existing model name from the drop-down list.

    Only letters, digits, and underscores (_) are allowed.

    Update Existing Table

    This parameter is displayed only when Name is set to an existing model name.

    It indicates whether to update the tables in the physical model if the tables in the logical model already exist in the target physical model during the model conversion. The system determines whether the table to be converted exists in the physical model based on the table code. When converting a logical model, you can only create or update the existing tables, but cannot delete them.

    • No: If you select this option, the existing tables will not be updated.
    • Yes: If you select this option, the existing tables will be updated. If a table is in the Published state, you need to publish the table again after updating it so that the updated table can take effect.

    Data Connection Type

    Select a data connection type from the drop-down list. If the required data type does not exist, you can add one by referring to Managing a Field Type.

    Data Connection

    The name of the data connection. Select the required data connection. You are advised to use the same data connection for an ER model.

    If you have not created a data connection yet, access to the DGC Management Center to create one. For details, see Creating Data Connections.

    Database

    The name of the database. Select a database from the drop-down list. If you have not created a database yet, access to the DGC Data Development console to create one. For details, see Creating a Database.

    Queue

    DLI queue. This parameter is displayed only for DLI data connections.

    Schema

    This parameter is displayed for DWS data connections.

    Description

    A description of the model. Up to 600 characters are supported.