Normalizing Models
The normalization process creates one or more objects and relationships based on the following logic:
-
Object datatype is converted to one-to-one relationships.
-
ArrayOfObject datatype is converted to one-to-many relationships.
Normalization is not the reverse of denormalization.
This section walks you through the normalization process and its outcome for the conversion of NoSQL models to SQL models. For example, the following process demonstrates the conversion of a MongoDB model to SQL model.
To normalize models, follow these steps:
-
Open your NoSQL model.
Observe that the MongoDB physical model has 4 collections and 0 relationships. Each of the four collections have objects or array of objects embedded within them.
The logical model contains relationships and does not contain any hierarchical datatypes.
-
In the Physical view mode, on the ribbon, click Actions > Target Database.
-
Change the Database from MongoDB to SQL Server and click OK.
The normalization process is performed and tables and relationships are created based on the embedded objects. Observe that the physical model contains 9 tables and 13 relationships.
The logical model has 9 entities and 13 relationships.
Physical to Logical Model Normalization
Due to the complete logical-physical model separation, the logical mode maintains the normalized form and the physical side always maintains the denormalized form. Whenever you switch from the physical model to the logical model, the model is auto-normalized and based on the embedding in the physical model, parent-child relationships are retained in the logical model.
For example, consider the following physical MongoDB model.
In this model:
-
E_2 is embedded as an ArrayOfObject.
-
E_3 is embedded as an Object.
Now, when you switch to the logical model, the model is normalized and based on the embedding, parent-child relationships are created. Object datatype is converted to one-to-one relationship and ArrayOfObject datatype is converted to one-to-many relationship.
Copyright © 2024 Quest Software, Inc. |