Types of Database Models | Database Management System
Types of Database Models | Database Management System
Types of Database Models : Database Systems can be categorized according to the data structures and operators they present to the user. The oldest systems fall into hierarchical and network systems. These are the pre-relational models.
In the Hierarchical Model, different records are inter-related through hierarchical or tree-like structures. A parent record can have several children, but a child can have only one parent. In the figure, there are two hierarchies shown – the first storing the relations between CUSTOMER, ORDERS, CONTACTS and ORDER PARTS and the second showing the relation between PARTS, ORDER PARTS and SALES HISTORY. The many-to-many relationship is implemented through the ORDER PARTS segment which occurs in both the hierarchies. In practice, only one tree stores the ORDER PARTS segment, while the other has a logical pointer to this segment. IMS (Information Management System) of IBM is an example of a Hierarchical DBMS.
The hierarchical data model organizes data in a tree structure. There is a hierarchy of parent and child data segments. This structure implies that a record can have repeating information, generally in the child data segments. Data in a series of records, which have a set of field values attached to it. It collects all the instances of a specific record together as a record type. These record types are the equivalent of tables in the relational model, and with the individual records being the equivalent of rows. To Create links between these record types, the hierarchical model uses Parent Child Relationships. These area 1:N mapping between record types. This is done by using trees, like set theory used in the relational model, “borrowed” from maths.
Hierarchial Database Systems
For example, an organization might store information about an employee, such as name, employee number, department, salary. The organization might also store information about an employee’s children, such as name and date of birth. The employee and children data forms a hierarchy, where the employee data represents the parent segment and the children data represents the child segment. If an employee has three children, then there would be three child segments associated with one employee segment. In a hierarchical database the parent-child relationship is one to many. This restricts a child segment to having only one parent segment. Hierarchical DBMSs were popular from the late 1960s, with the introduction of IBM’s Information Management System (IMS) DBMS, through the 1970s. A hierarchical schema consists of record types and PCR types:
- A record is a Collection offield values.
- Records of the same type are grouped into record types.
- A PCR type (parent-child relationship type) is a 1:N relationship between two record types.
- A hierarchical database schema consists of a number of hierarchical schemas.
In the Network Model, a parent can have several children and a child can also have many parent records. Records are physically linked through linked-lists. IDMS from Computer Associates international Inc. is an example of a Network DBMS.
Where the hierarchical model structures data as a tree of records, with each record having one parent record and many children, the network model allows each record to have multiple parent and child records, forming a lattice structure.
The chief argument in favour of the network model, in comparison to the hierarchic model, was that it allowed a more natural modeling of relationships between entities. Although the model was widely implemented and used, it failed to become dominant for two main reasons. Firstly, IBM choose to stick to the hierarchical model with semi-network extensions in their established products such as IMS and DL/I. Secondly, it was eventually displaced by the relational model, which offered a higher-level, more declarative interface.
The popularity of the network data model coincided with the popularity of the hierarchical data model. Some data were more naturally modeled with more than one parent per child. So, the network model permitted the modeling of many-to-many relationships in data. In 1971, the Conference on Data Systems Languages (CODASYL) formally defined the network model. The basic data modeling construct in the network model is the set construct. A set consists of an owner record type, a set name, and a member record type. A member record type can have that role in more than one set, hence the multiparent concept is Supported. An owner record type can also be a member or owner in another set. The data model is a simple network, and link and intersection record types (called junction records by IDMS) may exist, as well as Sets between them. Thus, the complete network of relationships is represented by several pairwiseSets; in each set some (one) record type is owner (at the tail of the network arrow) and one or more record types are members (at the head of the relationship arrow). Usually, a set defines a 1:M relationship, although 1:1 is permitted. The CODASYL network model is based on mathematical set theory.
Some Well-known Network Databases
- RDM. Embedded
- RDM Server
In the Relational Model, unlike the Hierarchical and Network models, there are no physical links. All data is maintained in the form of tables (relations) consisting of rows and Columns. Data in two tables is related through Common Columns and not physical links or pointers. Operators are provided for operating on rows in tables. Unlike the other two type of DBMS, there is no need to traverse pointers in the Relational DBMS. This makes querying much more easier in a Relational DBMS than in the the Hierarchical or Network DBMS. This, in fact, is a major reason for the relational model to become more programmer friendly and much more dominant and popular in both industrial and academic scenarios. Oracle, Sybase, DB2, ingres, informix, MS-SQL Server are few of the popular Relational DBMSs.
“In Relational model both entities and relationships are represented with the help of tables, only tables and nothing but tables.”
For example following are few RDBMSsample Tables/relations:
(RDBMS – relational database management system). A database based on the relational model developed by E.F. Codd. A relational database allows the definition of data structures, storage and retrieval operations and integrity constraints. In such a database the data and relations between them are organised in tables. A table is a collection of records and each recordina table contains the same fields.
Properties of Relational Tables:
- Values Are Atomic
- Each Row is Unique
- The Sequence of Columns is insignificant
- The Sequence of Rows is insignificant
- Each Column Has a Unique Name
Certain fields may be designated as keys, which means that searches for specific values of that field will use indexing to speed them up. Where fields in two different tables take values from the same set, a join operation can be performed to select related records in the two tables by matching values in those fields. Often, but not always, the fields will have the same name in both tables. For example, an “orders” table might Contain (customer-ID, product-code) pairs and a “products” table might contain (product-code, price) pairs So to Calculate a given Customer’s bill you would sum the prices of all products ordered by that customer by joining on the product-code fields of the two tables. This can be extended to joining multiple tables on multiple fields. Because these relationships are only specified at retrieval time, relational databases are classed as dynamic database management system. The RELATIONAL database model is based on the Relational Algebra.
Comparison of 3 models
Firstly, a hierarchical data model is designed in a tree (or parent-child) structure and allows only one-to-one or one-to-many relationships between entities. The model is fast when it comes to getting information, but it is not a flexible structure. Sometimes the role of the entity (parent or child) is not clear and unsuitable for a hierarchical model.
Secondly, a network data model has a more flexible structure than the hierarchical model and allows many-to-many relationships between the entities, but it easily becomes complex and difficult to manage.
Thirdly, the relational data model is more flexible than the hierarchical model and easier to manage than a network model. The relational data model is the most widely used model today.
Hierarchical databases link records like an organization chart. A record type can be owned by only one owner. In the following example, orders are owned by only one customer. Hierarchical structures were widely used with early mainframe systems; however, they are often restrictive in linking real-world Structures.
In network databases, a record type can have multiple owners. In the example below, Orders are owned by both customers and products, reflecting their natural relationship in business.
Relational databases do not link records together physically, but the design of the records must provide a common field, such as account number, to allow for matching. Often, the fields used for matching are indexed in order to speed up the process.
In the following example, customers, orders and products are linked by comparing data fields and/or indexes when information from more than one record type is needed. This method is more flexible for ad hoc inquiries. Many hierarchical and network DBMSs also provide this capability.
- This model is referred to as a upside down Tree structure.
- The elements of this model are known as nodes.
- The uppermost node is called Root node. The later nodes are either Parent node or Child node depending upon the situation. Parent- child nodes are inter-changeable.
- The main restriction of this modelis -Each child can have only One Parent. One parent can have more than 1 child.
- In this model the restriction of child having 1 parent does not exist. Every child can have more than 1 parent and every parent can have more than 1 child.
- This model is very flexible. Network model usually consists of records and links.
- In the network model any item can be related to any item.
- In the network model, mapping between parents and children is similar to hierarchical model, but mapping between parent-to-children is very complex.
Relational model represents a model that combines the simplicity of the hierarchical model with the flexibility of the network model. Relational model is constructed using the entities. An entity is defined as an item about which information is stored in the database. An entity can be Tangible or non-tangible. An example of Tangible entity would be Employee. An example of Non-tangible entity would be Customer account. Entities are defined using attributes. An attribute is the property of the entity for which information is Stored. These attributes are also known as columns. The group of column is known as row or a tuple. Also, a row can be defined as an instant of an entity. The entities are linked to each other using relationships. The relationship between entities can be of different types. The main types of the relationship are:
In this type of relationship one entity is connected or linked to another entity. Eg., Manager->Department
Every manager can manage only 1 department and every department can have only 1 manager.
The relationship between 2 entities is of more than 1. Eg. Employee->Department Every employee can be in 1 department only but 1 department can have more than 1 employee.
At a given time each entity can be linked to another in many form. Eg., Employee————>Project
An employee can be assigned to many projects and 1 project can have many employees. In relational model the entities and their relationships are represented by 2 dimensional array or table.
Every table represents an entity.
Every table consists of Rows and Columns.
Relationship between entities are represented by columns.
Each Column represents an attribute of the entity.
The values in the Columns are drawn from a domain or set of all possible values.
The Columns of the entity that are used to link the entities are known as Keys.
There are 2 types of keys. Primary and Foreign.
Primary key is defined as the Entity identifier. It uniquely identifies the entity. Example: The Social-Insurance-Number. The SIN identifies every person uniquely.
Foreign Key is defined as a Primary key of 1 entity that exists as an Attribute in another entity.
Advantages of Relational Model
- Ease of Use.
- Data Independence.
- Ease of implementation.
- Data merging.
- Data integrity.
Other Models (OODBMS)
- The recent developments in the area have shown up in the form of certain object and object/relational DBMS products. Examples of such systems are Gem Stone and Versant ODBMS. Research has also proceeded on to a variety of other schemes including the multi-dimensional approach and the logic-based approach. Few Features of OODBMS are:
- When you integrate database capabilities with object programming language capabilities, the result is an object-oriented database management System or ODBMS.
- An ODBMS makes database objects appear as programming language Objects in One or more existing programming languages.
- An object-oriented database system must satisfy two criteria: it should be a DBMS, and it should be an object-oriented system, i.e., to the extent possible, it should be consistent with the current crop of object-oriented programming languages. The first criterion translates into five features: persistence, secondary storage management, concurrency, recovery and an ad hoc query facility. The second one translates into eight features: complex objects, object identity, encapsulation, types or classes, inheritance, overriding combined with late binding, extensibility and Computational Completeness.
- An object-oriented database management system (OODBMS), sometimes shortened to ODBMS for object database management System), is a database management System (DBMS) that Supports the modelling and Creation of data as objects.
- This includes Some kind of Support for classes of objects and the inheritance of class properties and methods by subclasses and their objects. There is currently no widely agreed-upon standard for what constitutes an OODBMS, and OODBMS products are Considered to be still in their infancy.
Few Examples of OODBMS:
- D Gemstone
Few Applications of OODBMS:
- Object databases based on persistent programming are used in application areas such as engineering and spatial databases, telecommunications, and scientific areas such as high energy physics and molecular biology.
- They have made little impact on mainstream commercial data processing, though there is some usage in Specialized areas of financial Services.
- Another group of object databases focuses on embedded use in devices, packaged software and real time Systems. The reason to adapt is to create new objects according to users choice.