What Are The Different Types of Data Models?: Back To Articles List
What Are The Different Types of Data Models?: Back To Articles List
com/blog/types-data-models/
TECHNICAL
Tags: database modeling tool logical data model physical data model tag2database design
A data model determines the logical structure of a database. It helps you �nd
1 of 15 28-Aug-24, 8:31 PM
What Are the Different Types of Data Models? | Vertabelo Database Modeler https://vertabelo.com/blog/types-data-models/
possible design issues before implementing and deploying the database. However,
there are different types of data models which are used for different things. That’s
what we’ll discuss in this article.
The �rst step you should do when creating a new database is to model it. There are
some basic principles that should be followed in this case. By �rst taking the time to
model the database you will have a clearer picture of the problem. You can also
exchange ideas with your client and use the data model to help represent complex
business concepts in your discussions. You might also �nd and clarify potential
edge cases (unlikely but possible scenarios) that could change the data model, like
having to split a table into multiple tables to represent different sub-categories.
By modelling your data, �rst you can avoid having to make major changes after the
database is deployed.
A data model is a graphical way to design your database, allowing you to outline the
main concepts �rst. It gives you a standardized framework for representing real-
world entities and their properties. These entities are stripped down to their basic
components and are usually related to each other in some way. Everything – the
entities, their characteristics, and the relationships between entities – is
represented in a very simple way. Data models also help you describe how data
about the entities is organized, stored, and queried.
Here are some terms you need to know about data models:
2 of 15 28-Aug-24, 8:31 PM
What Are the Different Types of Data Models? | Vertabelo Database Modeler https://vertabelo.com/blog/types-data-models/
• Attributes are the characteristics that describe individual entities. For example,
a customer might be described by their �rst and last name, account number,
and email address. An item might be described by its product number, color,
and size. And an order will likely be identi�ed by its unique number and the
date it is placed. In a database, attributes are analogous to columns; a table
can have many columns, and each column can have one value per row
(although it can be the same value for multiple rows). In a data model,
attributes are listed inside each entity
• Relationships show which entities are connected. For example, an order entity
would be related to an item entity because the order is made up of various
items. Likewise, customers and orders would be connected because
customers place orders. In a data model, relationships are represented by lines
connecting entities.
In the end, all of these concepts should come together in a diagram like the one
below. But don’t worry, we’ll take you through all of the necessary steps to
understand and build a data model.
3 of 15 28-Aug-24, 8:31 PM
What Are the Different Types of Data Models? | Vertabelo Database Modeler https://vertabelo.com/blog/types-data-models/
There are many bene�ts of creating and maintaining a data model for your
database. I will outline and explain a few of these below.
From the business view, the bene�ts of having a data model are:
• A data model has a technical layer associated with it. This layer provides all of
the technical details (which are de�ned by the data architect), allowing the
developers to focus more on implementation and less on interpretation.
• Fewer errors. Thanks to the clarity and speci�city of the design in the data
model, fewer mistakes are made on the data and application side. Developers
can focus on feature implementation and not database design.
• The database structure can be optimized from the very beginning – before
data is inserted. This reduces the need to move data (i.e. to improve
performance after the database is in production).
• Reduced data risks. Having a clearer picture of the scale of the data, data
architects and database administrators can plan their backup and restore
strategies. Having plans and safeguards in place reduces risks in a disaster
recovery scenario.
4 of 15 28-Aug-24, 8:31 PM
What Are the Different Types of Data Models? | Vertabelo Database Modeler https://vertabelo.com/blog/types-data-models/
There are more bene�ts of using a data model in your process. You can read about
them in the article WHY DO YOU NEED DATA MODELING? .
Several types of stakeholders are involved in working with data models. Thus, there
are three different types of data models to suit the different needs of each
stakeholder. These are the:
Each data model builds on the preceding one to �nally generate the database
structure.
5 of 15 28-Aug-24, 8:31 PM
What Are the Different Types of Data Models? | Vertabelo Database Modeler https://vertabelo.com/blog/types-data-models/
This is the simplest data model and often the �rst to be created. It’s de�ned in an ER
DIAGRAM ( a simple chart showing entities, relationships, and sometimes attributes)
and shows the main entities and their relationships to each other. During this phase,
business stakeholders and the data architect are involved. Although this is the �rst
data model, it is not the �rst step in building a database. See this article to read
about ALL THE STEPS REQUIRED TO BUILD A DATABASE .
The role of the conceptual data model is to help de�ne the initial scope of the
problem. In addition, it helps organize the main business requirements, concepts,
and rules.
The result of building the conceptual data model is a diagram showing the main
entities, their attributes, and their relationships. If you’re not familiar with
relationships between database entities, I can recommend this ARTICLE ON THE
ESSENTIALS OF DATA RELATIONSHIPS. This knowledge will be useful going forward in
our discussion, so take some time to read about entity relationships before moving
on.
Here’s an example of a conceptual model. We’ll explain it in more detail later in the
article:
6 of 15 28-Aug-24, 8:31 PM
What Are the Different Types of Data Models? | Vertabelo Database Modeler https://vertabelo.com/blog/types-data-models/
The logical data model expands on the conceptual data model. We start by applying
NORMALIZATION TECHNIQUES with the goal of reaching 3NF (third normal form). Third
normal form is a way of structuring data storage so that it avoids duplications,
promotes referential integrity, and reduces the risk of incorrect or missing data.
After applying normalization, we make sure that all relationships are outlined. This
is the key step that differentiates the conceptual data model from the logical data
model.
Normalization will break our entities into multiple tables (if necessary) and set the
relationships between them. At this point, we no longer talk about entities; they’re
tables now. After a table is normalized, its attributes are clearly de�ned and the data
types are set. We also need to choose tables’ PRIMARY KEYS at this stage.
This is what a logical model looks like. Notice that there are more details provided
for the attributes and the relationships (i.e. the types of lines that connect the
tables):
7 of 15 28-Aug-24, 8:31 PM
What Are the Different Types of Data Models? | Vertabelo Database Modeler https://vertabelo.com/blog/types-data-models/
The physical data model is the �nal and most detailed data model. After we’ve
�nished this model, we have all the database and table details de�ned and ready to
be created.
During this phase, we �nalize the primary keys and create indexes to improve
performance. FOREIGN KEYS are also explicitly created to emphasize the relationship
between two tables. Views, users, and user access are also de�ned at this step in
order to create the data-access and security layer of the database.
Other important elements that are determined during this phase are nullable and
mandatory columns, default values, column constraints, and COLLATIONS . As you can
see, the physical model has even more detail:
8 of 15 28-Aug-24, 8:31 PM
What Are the Different Types of Data Models? | Vertabelo Database Modeler https://vertabelo.com/blog/types-data-models/
After this step is �nished, you can write the SQL DDL scripts to create the database.
Or, if you’re using a tool like Vertabelo, you can AUTOMATICALLY GENERATE YOUR DDL
SCRIPTS .
Step by Step
Now that we’ve gone through the theoretical part, let’s look at a practical example so
we can really understand the concepts.
Let’s �rst de�ne the scenario we want to model. Suppose we want to model the
database for an online store. The store needs to keep track of their products,
inventory, and orders. Additionally, customer information, such as delivery address
and login data, needs to be saved.
As we know, the �rst step in building a database is creating the conceptual data
model. For this example, I will be using the VERTABELO DATABASE MODELER because it
will provide some big bene�ts down the line.
Because the difference between the conceptual and logical data models is very
small, I will be creating a LOGICAL DIAGRAM in Vertabelo. However, since I’m starting
with simple entities that will later be expanded, we can safely call this a conceptual
model.
For our scenario, we’re going to have a diagram with only three entities: one entity to
store customer information, one for order information, and one for product
information. We also want to indicate the basic relationships between these
9 of 15 28-Aug-24, 8:31 PM
What Are the Different Types of Data Models? | Vertabelo Database Modeler https://vertabelo.com/blog/types-data-models/
entities. We’d have something like the data model shown below at the end of this
�rst phase.
In the logical model, we will apply normalization to the entities in the conceptual
model. After that, we’ll ensure that all the relationships between tables are set and
each table’s attributes are de�ned. In the end, we should have a logical data model
like the one shown below:
10 of 15 28-Aug-24, 8:31 PM
What Are the Different Types of Data Models? | Vertabelo Database Modeler https://vertabelo.com/blog/types-data-models/
You can see the difference between the conceptual and logical diagrams. Note that
I have:
This looks like a pretty detailed diagram for our use case. Now it’s time to create the
physical data model of our database.
If you’ve used the Vertabelo Data Modeler like me, you’re in luck. Vertabelo has a
built-in feature that allows you to generate a physical data model from your logical
model. There is a standalone tutorial ON HOW TO GENERATE A PHYSICAL DIAGRAM from a
logical model that explains this feature in detail. In my case, all I need is a quick
export from the logical data model. This is the result:
Customer Order_Product
ID int N PK Order_ID int N PK FK
first_name varchar(50) Product_ID int N PK FK
last_name varchar(50)
username varchar(50)
password varchar(100)
creation_date timestamp
Product
ID int N PK
EDIT MODEL IN YOUR BROWSER product_name varchar(100)
price decimal(8,2)
stock int
11 of 15 28-Aug-24, 8:31 PM
What Are the Different Types of Data Models? | Vertabelo Database Modeler https://vertabelo.com/blog/types-data-models/
After exporting, a new table called Order_Product appears. This is because the
Vertabelo modeler automatically creates linking tables if they are needed.
The generated physical model has also created foreign key columns in the Order
and Address tables; it automatically creates the required foreign keys between
tables.
It looks like our physical data model is complete! We now have a good foundation
on which to develop our database. This is where I will stop, but if you need to go one
step further, you can EXPORT THE PHYSICAL MODEL TO A SQL SCRIPT WITH DDL COMMANDS .
I hope you enjoyed this article on the different types of data models and why they
are useful. Building data models will help you as a software developer or a data
architect. Knowing when to use the right data model and how to involve business
stakeholders in the decision process is immensely useful. So, keep learning about
data modeling!
Tags: database modeling tool logical data model physical data model tag2database design
12 of 15 28-Aug-24, 8:31 PM
What Are the Different Types of Data Models? | Vertabelo Database Modeler https://vertabelo.com/blog/types-data-models/
Email address
SUBSCRIBE
TECHNICAL TECHNICAL
13 of 15 28-Aug-24, 8:31 PM
What Are the Different Types of Data Models? | Vertabelo Database Modeler https://vertabelo.com/blog/types-data-models/
TECHNICAL
Quick links
Documentation Pricing
FAQ Academy
Support
If you have any questions or you need our help, you can contact us through our
SUPPORT SITE
14 of 15 28-Aug-24, 8:31 PM
What Are the Different Types of Data Models? | Vertabelo Database Modeler https://vertabelo.com/blog/types-data-models/
Follow Us
15 of 15 28-Aug-24, 8:31 PM