Relationship

Learn about the Digibee Platform Relationship functionality

Gabrielly Pereira avatar
Written by Gabrielly Pereira
Updated over a week ago

IMPORTANT: This documentation has been discontinued. Read the updated Relationship documentation on our new documentation portal.

The Relationship functionality, based on the concept of Relational Data Model, allows you to create relationship models between entities based on different relationship types that can later be used when constructing pipelines via the Relationship component.

Located on the settings page of the Digibee platform, the "Relationship" submenu provides a list of all relationship models already created in the Platform, as well as their configuration parameters. In addition, you can also edit and delete existing Relationships and query data from related entities via actions, as explained in this article.

Types of relationships

The Relationship functionality supports three different relationship types. When creating a new relationship model, only one type should be chosen depending on the nature of the entities' attributes, that is, the data that you want to relate in the pipeline. They are:

  • ID translation: Allows you to create 1:1 (1 to 1) relationships between entities, with the possibility of overwriting data;

  • Parent child: Allows you to create 1:N (1 to many) relationships between entities;

  • ID translation no overwrite: Allows you to create 1:1 (1 to 1) relationships between entities, without the possibility of data overwriting.

Example of relationship

As an example, let us imagine two entities, Store and Employee. The entity Store has the data 'id' as an attribute, and the entity Employee, in turn, has the data 'name' as an attribute. See:

STORE

EMPLOYEE

id

name

In this case, we can establish the following rules:

  • A store, with a certain 'id' identifier, employs several employees;

  • An employee, with a particular 'name', works only in one store.

In addition, we can establish the following relationships:

  • The relationship between store and employee is 1:N (one store for many employees);

  • The relationship between employees and store is N:1 (many employees for a single store).

Using the Relationship functionality, we were able to relate the 'id' and 'name' data from the Store and Employee entities using the 'Parent child' relationship type. By relating this data, we could, for example, search for the names of all employees of a particular store using the store ‘id’ and the id of the store where a particular employee works by his or her ‘name’.

Thus, after creating the model, we will be able to incorporate it into the pipeline, so that related entities can be manipulated using the Relationship component.

“+ Create” button

To create a new Relationship model, simply click on the “Create” button in the upper right corner of the page and enter the following configuration parameters:

  • Name: Name of the relationship model. This parameter acts as a reference for the relationship model that will be used by the Relationship component in the pipeline;

  • Type: The type of relationship between entities. They are:

    • ID translation: Allows you to create 1:1 (1 to 1) relationships between entities, with the possibility of overwriting data;

    • Parent child: Allows you to create 1:N (1 to many) relationships between entities;

    • ID translation no overwrite: Allows you to create 1:1 (1 to 1) relationships between entities, without the possibility of data overwriting.

  • Field A: Identifier field of a relationship. It represents the origin, that is, the identifier data.

  • Field B: Field that stores the value related to its identifier (Field A). It represents the target, i.e. the target data.

  • Description: Description of the relationship model.

Edit Action (Pencil button)

This action allows editing all configuration parameters defined when creating the new Relationship. They are: Name, Type (ID translation, Parent child, ID translation no overwrite), Field A, Field B, and Description.

Search Action (Puzzle piece button)

This action allows the user to search for data from related entities within the relationship model in question. The parameters that help the user to perform the search are:

  • Environment: The environment in which the related data is located, which can be:

    • test;

    • prod.

  • Field: It is possible to select a field among those already configured when creating the relationship model (Field A or Field B);

  • Value: Data registered in the relationship model, based on the aforementioned Field.

IMPORTANT: Inserting, updating, and deleting data from a relationship model is done through the Relationship component, which takes into account the environment in which the pipeline was deployed to perform these actions.

For example: to insert, update, and delete data from a relationship model created in test, simply run the pipeline in test-mode itself or deploy it in the test environment; to insert, update, and delete data from a relationship model created in prod, simply deploy it in the prod environment.

Remove Relationship Action (Trash Bin button)

This action allows you to delete a relationship model if it is not used on the platform, whether in pipelines already deployed, non-deployed, or archived ones.

IMPORTANT: By clicking on “Confirm”, the action cannot be undone.

Did this answer your question?