2. TYPES OF DATABASE MODELS
A DBMS can take any one of the several available approaches to manage data. Each
approach constitutes a database model. A database model is a collection of descriptions of data
structures and their contained fields, together with the operations or functions that manipulate
them. It is a comprehensive scheme for describing how data is to be represented for manipulation
by human or computer programs. A thorough model details the types of data, the topological
arrangements of data, spatial and temporal maps onto which data can be projected, and the
operations and structures that can be invoked to handle data and its maps.
Following are the various database models in existence:-
1. Filing system/ File processing system
Prior to DBMS, file system provided by conventional operating system was used to store
information. The system stores permanent records in various files, and needs different
application programs to extract records from, and add records to, the appropriate files. Each
program defines and manages its own data. Keeping information in a file-processing system has
a number of major disadvantages:
Data redundancy and inconsistency – data redundancy refers to unnecessary repetition
of data, i.e. data being stored more than once. In file system this problem arises due to
decentralized approach. Redundancy of data leads to wastage of storage space thus
increasing cost. In addition, it may lead to data inconsistency, that is, various copies of
the same data may no longer agree. E.g. a student gives his address to both main office
and IT department. Later he changes the address in the IT department but this does not
reflect in the main office.
Difficulty in accessing data – convectional file-processing environments do not allow
needed data to be retrieved in a convenient and efficient manner because information is
either extracted manually or programmers are required to write necessary application
programs every time particular information is needed.
Data isolation – data are scattered in various files and those files may be in different
formats. Writing application programs to retrieve data is difficult.
Integrity problems – data values stored in a database must satisfy certain types of
consistency constraints. It is difficult to enforce such constraints in a file system since
there are several data items from different files.
1
, Atomicity problems – a computer system is subject to failure. It is crucial that if a
failure occurs, the data be restored to the consistent state that existed prior to the failure.
For example, suppose a program to transfer Ksh.500 from account balance of department
A to the account balance of department B. If system failure occurs during the execution
of the program, it is possible that the Ksh.500 was removed from account A but not
credited to account B. such transfers must be atomic- it must happen in its entirety or not
all. It is difficult to ensure atomicity in convectional file systems.
Concurrent access anomalies – for the sake of overall performance of the system and
faster response, many systems allow multiple users to update data simultaneously. In
such environments, interaction of concurrent updates is possible and may result in
inconsistent data. Consider a department A with account balance of Ksh.10000. If two
cashiers debit the account with Ksh.500 and 100 respectively and almost at the same
time, then it is possible that the cashiers read old balance, reduce the balance by
respective amount being withdrawn and write results back. If this happens at the same
time they may both write back Ksh.9500 and 9900 respectively. This is because in file
processing systems, it is difficult to maintain some form of supervision.
Security problems – not every user of the database should be able to access all the data.
For example, in a university, payroll personnel need to see only financial information
only but not academic records. But since application programs are added the file based
systems in an ad hoc manner, enforcing such security constraints is difficult.
2. Hierarchical model
This is a data model based on trees and uses Parent Child relationship from which links
between record types are created. These are a 1: N mapping between record types. 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 through the 1970s. Consider another example of a class which has both
2
A DBMS can take any one of the several available approaches to manage data. Each
approach constitutes a database model. A database model is a collection of descriptions of data
structures and their contained fields, together with the operations or functions that manipulate
them. It is a comprehensive scheme for describing how data is to be represented for manipulation
by human or computer programs. A thorough model details the types of data, the topological
arrangements of data, spatial and temporal maps onto which data can be projected, and the
operations and structures that can be invoked to handle data and its maps.
Following are the various database models in existence:-
1. Filing system/ File processing system
Prior to DBMS, file system provided by conventional operating system was used to store
information. The system stores permanent records in various files, and needs different
application programs to extract records from, and add records to, the appropriate files. Each
program defines and manages its own data. Keeping information in a file-processing system has
a number of major disadvantages:
Data redundancy and inconsistency – data redundancy refers to unnecessary repetition
of data, i.e. data being stored more than once. In file system this problem arises due to
decentralized approach. Redundancy of data leads to wastage of storage space thus
increasing cost. In addition, it may lead to data inconsistency, that is, various copies of
the same data may no longer agree. E.g. a student gives his address to both main office
and IT department. Later he changes the address in the IT department but this does not
reflect in the main office.
Difficulty in accessing data – convectional file-processing environments do not allow
needed data to be retrieved in a convenient and efficient manner because information is
either extracted manually or programmers are required to write necessary application
programs every time particular information is needed.
Data isolation – data are scattered in various files and those files may be in different
formats. Writing application programs to retrieve data is difficult.
Integrity problems – data values stored in a database must satisfy certain types of
consistency constraints. It is difficult to enforce such constraints in a file system since
there are several data items from different files.
1
, Atomicity problems – a computer system is subject to failure. It is crucial that if a
failure occurs, the data be restored to the consistent state that existed prior to the failure.
For example, suppose a program to transfer Ksh.500 from account balance of department
A to the account balance of department B. If system failure occurs during the execution
of the program, it is possible that the Ksh.500 was removed from account A but not
credited to account B. such transfers must be atomic- it must happen in its entirety or not
all. It is difficult to ensure atomicity in convectional file systems.
Concurrent access anomalies – for the sake of overall performance of the system and
faster response, many systems allow multiple users to update data simultaneously. In
such environments, interaction of concurrent updates is possible and may result in
inconsistent data. Consider a department A with account balance of Ksh.10000. If two
cashiers debit the account with Ksh.500 and 100 respectively and almost at the same
time, then it is possible that the cashiers read old balance, reduce the balance by
respective amount being withdrawn and write results back. If this happens at the same
time they may both write back Ksh.9500 and 9900 respectively. This is because in file
processing systems, it is difficult to maintain some form of supervision.
Security problems – not every user of the database should be able to access all the data.
For example, in a university, payroll personnel need to see only financial information
only but not academic records. But since application programs are added the file based
systems in an ad hoc manner, enforcing such security constraints is difficult.
2. Hierarchical model
This is a data model based on trees and uses Parent Child relationship from which links
between record types are created. These are a 1: N mapping between record types. 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 through the 1970s. Consider another example of a class which has both
2