Hierarchical Database Model
Hierarchical Database Model
Types of data model:
1. Object based logical model
a. ER-model
a. Functional model
a. Object oriented model
a. Semantic model
2. Record based logical model
a. Hierarchical database model
a. Network model
a. Relational model
3. Physical model: These models can be used in describing the data at the
lowest level, i.e. physical level. These models can be classified into
1. Unifying model
2. Frame memory model
HIERARCHICAL MODEL:
In this model, data is stored in the form of records which are the collection of
fields.
The records are connected through links
It must have only one parent for each child node but parent nodes can have
more than one child. Multiple parents are not allowed. This is the major
difference between the hierarchical and network database model.
When data needs to be retrieved then the whole tree is traversed starting from
the root node.
Let us see one example: Let us assume that we have a main directory which
contains other subdirectories. Each subdirectory contains more files and
directories. Each directory or file can be in one directory only i.e. it has only
one parent.
APPLICATIONS:
Today, it is used mainly for storing file systems and geographic information.
Data can be retrieved easily due to the explicit links present between the table
structures.
Referential integrity is always maintained i.e. any changes made in the parent
table are automatically updated in a child table.
Increases specialization.
High performance.
Clear results.
Disadvantages
GRAPH
CHARACTERISTICS:
One child entity can have more than one parent entity. For example, in the
figure, the Subject has two children. One child is a STUDENT and another one
is Degree.
Represented as a network and one child can have more than one parent. This
model represents a complex structure.
Entities can have multiple parent entities and lead to a complex structure.
High performance
The network model allows creating more complex and stronger queries as
compared to the database with a hierarchical database model. A user can
execute a variety of database queries when selecting the network model.
The network model is a very complex database model, so the user must be very
familiar with the overall structure of the database.
Updating inside this database is a quite difficult and boring task. We need the
help of the application programs that is being used to navigate the data.
RELATIONAL MODEL
Each data value is a simple number or a character string. That is a table must be
in first normal form.
The columns of a table are assigned distinct names and the ordering of these
columns in immaterial.
Attribute: Each column in a Table. Attributes are the properties which define a
relation. e.g., Student_Rollno, NAME,etc.
Tables – In the Relational model the, relations are saved in the table format. It is
stored along with its entities. A table has two properties rows and columns.
Rows represent records and columns represent attributes.
Tuple – It is nothing but a single row of a table, which contains a single record.
Relation Schema: A relation schema represents the name of the relation with its
attributes.
Degree: The total number of attributes which in the relation is called the degree
of the relation.
Cardinality: Total number of rows present in the Table.
Column: The column represents the set of values for a specific attribute.
Relation key - Every row has one, two or multiple attributes, which is called
relation key.
Attribute domain – Every attribute has some pre-defined value and scope which
is known as attribute domain
Objects
The real world entities and situations are represented as objects in the Object
oriented database model.
Every object has certain characteristics. These are represented using Attributes.
The behaviour of the objects is represented using Methods.
Class
Similar attributes and methods are grouped together using a class. An object can
be called as an instance of the class.
Inheritance
A new class can be derived from the original class. The derived class contains
attributes and methods of the original class as well as its own.
ANOTHER EX Shape, Circle, Rectangle and Triangle are all objects in this
model.
The objects Circle, Rectangle and Triangle inherit from the object Shape.
Homogeneous DDBMS
In a homogeneous DDBMS, the database management systems across all locations
are uniform and based on the same data model. These database management
systems are much easier to handle and the database can even be scaled if required.
In a homogeneous distributed database, all the sites use identical DBMS and
operating systems. Its properties are −
● The sites use very similar software.
● The sites use identical DBMS or DBMS from the same vendor.
● Each site is aware of all other sites and cooperates with other sites to
process user requests.
● The database is accessed through a single interface as if it is a single
database.
Heterogeneous DDBMS
In heterogeneous DDBMS, the database management systems across different
locations may be based on different data models such as relational, hierarchical,
object oriented etc. This type of database systems are a result of later integration of
individual database systems. They are quite complicated and difficult to manage.
In a heterogeneous distributed database, different sites have different operating
systems, DBMS products and data models. Its properties are −
● Different sites use dissimilar schemas and software.
● The system may be composed of a variety of DBMSs like relational, network,
hierarchical or object oriented.
● Query processing is complex due to dissimilar schemas.
● Transaction processing is complex due to dissimilar software.
● A site may not be aware of other sites and so there is limited co-operation in
processing user requests.
Advantages
The distributed database can have the data arranged according to different levels of
transparency i.e data with different transparency levels can be stored at different locations.
● If there were a natural catastrophe such as a fire or an earthquake, all the data would
not be destroyed as it is stored at different locations.
● It is cheaper to create a network of systems containing a part of the database. This
database can also be easily increased or decreased.
● Even if some of the data nodes go offline, the rest of the database can continue its
normal functions.
Disadvantages
● The distributed database is quite complex and it is difficult to make sure that a user
gets a uniform view of the database because it is spread across multiple locations.
● It is difficult to provide security in a distributed database as the database needs to be
secured at all the locations it is stored. Moreover, the infrastructure connecting all the
nodes in a distributed database also needs to be secured.
● It is difficult to maintain data integrity in the distributed database because of its
nature. There can also be data redundancy in the database as it is stored at multiple
locations.