Relationships

Learn more by watching the video!

A relationship allows you to link multiple data objects. When you use relationships, you ensure that the data between the two data sources is properly linked.

When you create a relationship, you need to specify which data object is the parent (the primary key) and which one is the child (the foreign key). The child data object cross-references its data with a unique attribute in the parent data object.

Relationships explained

Let's look at the relationship between the Customer and Order Item data objects. The default data model configures the ID attribute from Customer as the parent, and the Customer ID attribute from Order Item as the child.

An image of the Relationships section

The following attributes are relevant.

Customer data object

  • ID: Values that are internally generated as a concatenation of Source ID and Source Customer ID. This is the parent in the relationship.

  • Source ID: Identifies the source of data. For example, the value can be Responsys or CRM.

  • Source Customer ID: The ID value originating from the source system that guarantees uniqueness for the customer record.

Order Item data object

  • ID: Values that internally generated as a concatenation of Source ID and Source Order ID.

  • Source ID: Identifies the source of the order data. For example, the value can be Commerce Cloud.

  • Source Order ID: The order ID value originating from the source system that guarantees uniqueness for the order record.

  • Source Customer ID: The ID value originating from the source system that guarantees uniqueness for the customer record.

  • Customer ID: Values that originate from the ID attribute from the Customer data object and are generated during data ingestion. It is a concatenation of Source ID and Source Customer ID. This is the child in the relationship.

During data ingestion, Oracle Unity will do the following:

  • Generate values for the parent in the relationship (ID in Customer).

  • Insert the ID value from Customer into the Customer ID attribute in Order Item.

  • Link order records in the Order Item data object with corresponding customer records in the Customer data object.

The benefit of this relationship is that you can create segments that target customers that have corresponding order item data linked to their customer record.

Relationship example

The following attribute values exist in the Customer data object for one customer record.

ID Source ID Source Customer ID
Responsys100 Responsys 100
  • The source of the customer record (Source ID) originates from Responsys.

  • The Responsys identifier for this customer (Source Customer ID) is 100.

  • Oracle Unity generates a value for this customer record (ID) by concatenating Source ID and Source Customer ID.

After ingesting order data into Oracle Unity, the following attribute values exist for an order placed by this customer.

The customer placed an order on the website through an email campaign launched by Responsys.

ID Source ID Source Order ID Source Customer ID Customer ID
ResponsysR900 Responsys R900 100 Responsys100
  • The source of the order record (Source ID) originates from Responsys.

  • The Responsys identifier for this order (Source Order ID) is R900.

  • Oracle Unity generates a value for this customer record (ID) by concatenating Source ID and Source Order ID.

  • The Responsys identifier for this customer (Source Customer ID) is 100.

  • During data ingestion for the order data, the order record is linked to the corresponding customer record in the Customer data object and the Customer ID value is automatically generated and inserted into this order record.

Next steps

Creating relationships

Learn more

Data objects

foreign key, what is a foreign key, create foreign key, delete foreign key, manage foreign key, edit foreign key, relationship, what is a relationship, create relationship, delete relationship, manage relationship, edit relationship