GenRocket Parent/Child/Sibling Relationships Concepts

GenRocket Parent/Child/Sibling Relationships Concepts govern the way complex Domain models can be easily represented and manipulated with full referential integrity.

An Example

For this example, the following Entity Relationship Diagram will be used.

This diagram describes a common, normalized database model of a user entity having foreign key relationships to three other entities: department, role, and security_level. In a database, these three entities are seen as Parents to the user entity.

Let’s also assume that there are three roles: Manager (MGR), Supervisor (SPV), and Employee (EMP). Additionally, there are 5 Security Levels: L1, L2, L3, L4, and L5.

If we want to generate only 100 users for a single department, traversing all three entities as a parent to the user entity, makes generating only 100 rows of user test data virtually impossible.

Why? Because of the number of permutations necessary to produce all possible parent/child combinations of user test data.

For 1 department, 3 roles, and 5 security levels, we would need 1,500 permutations to satisfy all possible combinations for just 100 users.

For 10 departments with 3 roles and 5 security levels, our permutations jump from 1,500 users to 15,000 users.

If we want 10 departments each to have 1000 users, our permutations jump from 15,000 users to 150,000 users.

And if we change the number of roles to 5 and the number of security levels to 10, our permutations would jump from 150,000 users to 500,000 users.

How then can we generate only 100 users for one department and manage to produce all possible roles and security levels within the set of 100 users?

By following one simple rule! In GenRocket, an entity may have only one parent, but can have many siblings.

Since role and security_level are adjectives that help describe the user, department should be the parent of user. Role and security_level should be siblings to the user.

Having only one parent and many siblings, GenRocket will produce the user test data in the following manner:

  1. First, it will generate data for one department, because department is the parent of user.
  2. Before each of the 100 users is generated, one row from each of the siblings is generated.
  3. And now that the user has full referential integrity from its parent and sibling relationships, the user test data can be generated.

This process will repeat itself until all 100 users are generated, yielding all unique combinations of roles and security levels, guaranteeing full referential integrity.


Related Assets

GenRocket - Test Data Management

Download Literature

View Literature
GenRocket - Test Data Management

Parent, Child, and Sibling Relationships

That's right, GenRocket can generate synthetic data with full referential integrity to meet your test data needs.

Read More
GenRocket - Test Data Management

How can we help
you today?

Request a Demo

See how GenRocket can solve your toughest test data challenge with quality synthetic data by-design and on-demand