Different types of Database Models

author-image
CIOL Bureau
Updated On
New Update

Undoubtly, databases have become an essential part of everyday life. Every day we engage ourselves in several activities that involve interaction with databases, like when we book an airline ticket, when we deposit or withdraw money from the bank or when we want information about an employee, etc.

Advertisment

A database is a collection of related data that can be retrieved easily, effectively and quickly. By data, we mean everyday facts, which can be recorded and have explicit meaning. For example, the name of an employee, telephone number, address etc, can be data items that are required by a company and need to be stored in an organized way, so that they can be easily accessed, whenever required. A database can be of any size and complexity and involves data, hardware, which physically stores data, and software for storing and managing data.

A Database Management System (DBMS) is a database manger, which enables users to create and maintain databases. The way data is actually stored in a database and managed by a DBMS is defined by a database model. Essentially, there are three types of database models: Relational, Hierarchical and Network. Out of these, relational model is the most widely used and is employed in most modern database products, such as Oracle, MS Access, MySQL, MS SQL Server and DB2.

Relational Database


Relational database stores data in the form of tables (also called a relation) with different tables linked to each other via some data item. Data can be accessed or reassembled from tables in many ways without reorganizing the database tables. Each table contains one or more data categories in columns (also called fields). Data values for every column are stored in rows, which are also called tuples. Each tuple represent one record value.

Advertisment

When creating a relational database, we can define a domain of possible values in a data column and further constraints that may apply to that data value. For example, one or more fields can be assigned as index keys, which will speed up the search process, when searching using the index.

In relational database one or more fields can also be assigned as a key called primary key which ensures that only unique values can be assigned in each row for that field(s). Primary key is used to identify individual tuples in a relation. A primary key cannot have null values. A relation can have more than one key. In such case, each key is called as candidate key and one of the candidate key is assigned as primary key.

Two or more tables can be related to each other with the help of a foreign key. One or more fields of a table can be assigned as foreign key and are linked to a primary key field of another table. A tuple in one relation that refers to a second relation must refer to an existing tuple in the second relation.

Advertisment

Entity/Relationship Modeling

is the simplest form of describing the relationship between entities. An entity is a real world thing that can be uniquely defined. Associated with each entity is a set of attributes, which help to describe the entity. Each entity has a value for each attribute. For example, a customer or a book can be an entity. Each customer has a name and each book has a title and an author that are their attributes. Relationship is formed between entities such as a customer places an order for a book. Here order is the relation between the customer and the book.

The cardinality ratio for a relationship specifies the number of relational instances that an entity can participate. For example, relationship between customer and book is a many-to-many relationship (M: N) because many customers can order several books and many books can be ordered by several customers.

In ER-diagram notations, each entity is drawn as rectangle. Each of the entity's attribute is drawn as ellipse with a line linking the entity to the attribute. Relationship is drawn as diamond linking them to the related entities.

Advertisment

Normalization

is the process of analyzing database structure to minimize data redundancy and insertion, deletion and update anomalies. There are several levels of normalization and as we move up the normalization ladder, bigger database tables are broken into more and more smaller tables. However, this decreases performance of the database because the server, now, has to work with more tables, but on the whole, normalization simplifies database designing.

Hierarchical Database


Hierarchical Database defines two types of data structuring concept: records and parent-child relationships. A record is a collection of field values. Records of similar types are grouped together into record types. A record type is given a value and its structure is defined by a collection of field names.

A Parent-Child Relationship type (PCR) is a one-to-many (1:N) relationship between two record types. One record type, called the root, does not participate as a child record type in any PCR relationship. Every record type, except the root, participates as a child record in only one relation. A parent record can participate in as many PCR relationships. A record that does not participate in any relationship, as parent, is called leaf record.

Advertisment

Hierarchical database defines a tree data structure. It can be visualized as an inverted tree structure with root at the top from which child record type branches out. At the subsequent levels there are child records, which are also the parent records of the records at the lower level. A parent record can have as many child records but a child record can have only one parent record thus forming a 1:N relationship.

Hierarchy structures were widely used in first mainframe DBMSs, but due to technical limitations, they often cannot be used to relate structures that exist in the real world.

IBM's Information Management System (IMS) for Linux and IBM's DL/I (Data Language I) for the VSE operating system uses Hierarchical database model.

Advertisment

 


Network Database


The original network model was presented in the CODASYL (Conference on Data Systems Languages) Data Base Task Group's 1971 report. This database defines two data structuring concepts: records and sets.

Data is stored in records; consist of a group of related data values, which are grouped in record types. Each record type is given a name. A set is a description of one-to-one relationship between two record types.


This database is similar to hierarchical database. The network model uses set theory to provide a tree-like hierarchy with the exception that child tables were allowed to have more than one parent. This allowed the network model to support many-to-many relationships. A child can have many parents and a parent can have many children, forming an interlinked network.


There have been some implementations of CODASYL system on the market like DMS, Total from cincom and CA-IDMS. Total went out of business in the late 80th. Still marketed now with SQL support is CA-IDMS.

tech-news