A database model is a type of data model that determines the logical structure of a database and fundamentally determines in which manner data can be stored, organized, and manipulated. The most popular example of a database model is the relational model, which uses a table-based format.
Database Model |
Logical Database Models
- Hierarchical model
- Network model
- Relational model
- Entity–relationship model
- Object model
- Document model
- Entity–attribute–value model
- Star schema
Hierarchical model
Hierarchical model |
This
model is the first recognized database model created by IBM in the 1960s. A
hierarchical database model is a data model in which the data is organized like
tree structure. The structure allows representing information using
parent/child relationships, each parent can have many children, but each child
has only 1 parent (it is known as 1-to-many relationship).
Every
attributes of a specific record are listed under an entity type. In a database
an entity type is the equivalent of a table. Each individual record is
represented as a row, and each attribute as a column. Entity types are related
to each other using 1:N mappings, also known as one-to-many relationships.
Network model
Network model |
The
network model is a database model conceived as a flexible way of representing
objects and their relationships. Its distinguishing feature is that the schema,
viewed as a graph in which object types are nodes and relationship types are
arcs, is not restricted to being a hierarchy or lattice.
This
model's original inventor was Charles Bachman. It was developed in a standard
specification and published in 1969 by the Conference on Data Systems Languages
(CODASYL) Consortium.
In
1971, a second publication was released, which became the basis for most
implementations. Also in early 1980's the subsequent work continued and
culminating in an ISO specification, but this had little influence on products.
Relational model
Relational model |
In 1969, Edgar F.
Codd is the first to formulate and propose the relational model for database
management as a database model based on first-order predicate logic.
In the relational
model of a database, all data is represented in terms of tuples, grouped into
relations. A database organized in terms of the relational model is a
relational database.
The purpose of the
relational model is to provide a declarative method for specifying data and
queries: users directly state what information the database contains and what
information they want from it, and let the database management system software
take care of describing data structures for storing the data and retrieval
procedures for answering queries.
Most relational
databases use the SQL data definition and query language; these systems
implement what can be regarded as an engineering approximation to the
relational model. A table in an SQL database schema corresponds to a predicate
variable; the contents of a table to a relation; key constraints, other
constraints, and SQL queries correspond to predicates. However, SQL databases,
including DB2, deviate from the relational model in many details, and Codd
fiercely argued against deviations that compromise the original principles.
Entity - Relational model
Entity - Relational model |
Entity–relationship-modeling
is a data modeling technique used in software engineering to produce a
conceptual data model of a information system. Diagrams created using this
ER-modeling technique are called Entity-Relationship Diagrams, or ER diagrams
or ERDs. So you can say that Entity Relationship Diagrams illustrate the
logical structure of databases.
Dr. Peter Chen is
the originator of the Entity-Relationship Model. His original paper about
ER-modeling is one of the most cited papers in the computer software field.
Currently the ER model serves as the foundation of many system analysis and
design methodologies, computer-aided software engineering (CASE) tools, and
repository systems.
Object model (Object oriented database management systems - OODBMS)
Object oriented database management systems |
An object database
also known as object-oriented database management system is one of the database
management system in which the information is represented in the form of
objects as used in object-oriented programming like Java, C++, C#, Python,
Perl, Visual Basic .NET... Object databases are different from relational
databases which are table-oriented. Object-relational databases are a hybrid of
both approaches.
As the usage of
web-based technology increases with the implementation of Intranets and
extranets, companies have a vested interest in OODBMSs to display their complex
data.
Object oriented
database management systems (OODBMSs) combine database capabilities with
object-oriented programming language capabilities. OODBMSs allow
object-oriented programmers to develop the product, store them as objects, and
replicate or modify existing objects to make new objects within the OODBMS.
Because the database is integrated with the programming language, the
programmer can maintain consistency within one environment, in that both the
OODBMS and the programming language will use the same model of representation.
Relational DBMS projects, by way of contrast, maintain a clearer division
between the database model and the application.
Document model
A
document-oriented database is a designed computer program for storing,
retrieving, and managing document-oriented information, also known as
semi-structured data. Document-oriented databases are one of the main
categories of so-called NoSQL databases and the popularity of the term
"document-oriented database" (or "document store") has
grown with the use of the term NoSQL itself. In contrast to well-known
relational databases and their notions of "Relations" (or
"Tables"), these systems are designed around an abstract notion of a
"Document".
The main
objective of a document-oriented database is the notion of a Document. While
each document-oriented database implementation differs by definition, but in
general, they all assume documents encapsulate and encode data (or information)
in some standard formats or encodings. Encodings that are used in XML, YAML,
JSON, and BSON, as well as binary forms like PDF and Microsoft Office documents
(MS Word, Excel, and many more).
Documents
inside a document-oriented database are similar, in some ways, to records or
rows in relational databases, but they are less rigid. They are not required to
adhere to a standard schema, nor will they have all the same sections, slots,
parts, or keys.
Example 1:
{
FirstName: "Altaf",
Address: "27 First St",
Hobby: "Cricket"
}
Example 2:
{
FirstName: "Raja",
Address: "15th Avenue Cross street",
Children: [
{Name: "Babu", Age: 15},
{Name: "Ravi", Age: 11},
{Name: "Suman", Age: 8},
]
}
These
two documents share some structural elements with one another, but each also
has unique elements. Unlike a relational database where every record contains
the same fields, leaving unused fields empty; there are no empty 'fields' in
either document (record) in the above mentioned example. This approach allows
new information to be added to some records without requiring that every other
record in the database share the same structure.
Entity–attribute–value model
Entity–attribute–value
model is also known as object–attribute–value model, vertical database model
and open schema. EAV is a data model to describe entities where the number of
attributes (properties, parameters) that can be used to describe them is
potentially vast, but the number that will actually apply to a given entity is
relatively modest.
In
mathematics, this model is known as a sparse matrix. There are certain cases
where an EAV schematic is an optimal approach to data modelling for a problem
domain.
However,
in many cases where data can be modelled in statically relational terms an EAV
based approach is an anti-pattern which can lead to longer development times,
poor use of database resources and more complex queries when compared to a
relationally-modelled data schema.
Star schema model
Star
schema model is also known as star-join schema. The star schema is the simplest
style of data mart schema. The star schema consists of one or more fact tables
referencing any number of dimension tables. The star schema is an important
special case of the snowflake schema, and is more effective for handling
simpler queries.
The star
schema gets its name from the logical model's resemblance to a star with a fact
table at its center and the dimension tables surrounding it representing the
star's points.