0% found this document useful (0 votes)
2 views

Database System Concepts and Architecture

The document discusses various data models used in database systems, including hierarchical, network, entity-relationship, relational, object-oriented, object-relational, flat, and context data models. It explains the architecture of database management systems (DBMS), including 1-tier, 2-tier, and 3-tier architectures, as well as the three-schema architecture that separates user applications from the physical database. Additionally, it highlights the importance of schemas and instances in representing the structure and data within a database.

Uploaded by

annapoovathinkal
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Database System Concepts and Architecture

The document discusses various data models used in database systems, including hierarchical, network, entity-relationship, relational, object-oriented, object-relational, flat, and context data models. It explains the architecture of database management systems (DBMS), including 1-tier, 2-tier, and 3-tier architectures, as well as the three-schema architecture that separates user applications from the physical database. Additionally, it highlights the importance of schemas and instances in representing the structure and data within a database.

Uploaded by

annapoovathinkal
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 43

Database System

Concepts and
Architecture
III SEM BCA
Data models
• Data Model gives us an idea that how the final system will look like after its
complete implementation. It defines the data elements and the relationships between
the data elements.
• Data Models are used to show how data is stored, connected, accessed and updated
in the database management system. Here, we use a set of symbols and text to
represent the information so that members of the organisation can communicate and
understand it.
• Though there are many data models being used nowadays but the Relational model
is the most widely used model.
• DBMS allows a user to specify the data to be stored in terms of a data model.
A data model is a collection of higher level data description constraints that hides
lower level storage details. It is the collection of concepts that can be used to
describe the structure of a database.
Types of Data models
1.Hierarchical Model
2.Network Model
3.Entity-Relationship Model
4.Relational Model
5.Object-Oriented Data Model
6.Object-Relational Data Model
7.Flat Data Model
8.Context Data Model
Hierarchical Model
• Hierarchical Model was the first DBMS model. This model organises the data in
the hierarchical tree structure.
• The hierarchy starts from the root which has root data and then it expands in the
form of a tree adding child node to the parent node.
• This model easily represents some of the real-world relationships like food
recipes, sitemap of a website etc.
• Example: We can represent the relationship between the shoes
present on a shopping website in the following way:
• Features of a Hierarchical Model
• One-to-many relationship: The data here is organised in a tree-like structure
where the one-to-many relationship is between the datatypes. Also, there can be
only one path from parent to any node. Example: In the above example, if we
want to go to the node sneakers we only have one path to reach there i.e through
men's shoes node.
• Parent-Child Relationship: Each child node has a parent node but a parent node
can have more than one child node. Multiple parents are not allowed.
• Deletion Problem: If a parent node is deleted then the child node is automatically
deleted.
• Pointers: Pointers are used to link the parent node with the child node and are
used to navigate between the stored data. Example: In the above example the
'shoes' node points to the two other nodes 'women shoes' node and 'men's shoes'
node.
Network model
• This model is an extension of the hierarchical model. It was the most popular
model before the relational model. This model is the same as the hierarchical
model, the only difference is that a record can have more than one parent. It
replaces the hierarchical tree with a graph.
• Example: In the example below we can see that node student has two parents i.e.
CSE Department and Library. This was earlier not possible in the hierarchical
model.
Entity Relationship model
• Entity-Relationship Model or simply ER Model is a high-level data model
diagram. In this model, we represent the real-world problem in the pictorial form
to make it easy for the stakeholders to understand. It is also very easy for the
developers to understand the system by just looking at the ER diagram. We use the
ER diagram as a visual tool to represent an ER Model.
• ER diagram has the following three components:

• Entities: Entity is a real-world thing. It can be a person, place, or even a concept.


Example: Teachers, Students, Course, Building, Department, etc are some of the
entities of a School Management System.
• Attributes: An entity contains a real-world property called attribute. This is the
characteristics of that attribute. Example: The entity teacher has the property like
teacher id, salary, age, etc.
• Relationship: Relationship tells how two attributes are related. Example: Teacher
works for a department.
Relation Model
• Relational Model is the most widely used model. In this model, the data is
maintained in the form of a two-dimensional table. All the information is stored in
the form of row and columns. The basic structure of a relational model is tables.
So, the tables are also called relations in the relational model. Example: In this
example, we have an Employee table.
Object Oriented Data Model
• The real-world problems are more closely represented through the object-oriented
data model. In this model, both the data and relationship are present in a single
structure known as an object.
• We can store audio, video, images, etc in the database which was not possible in
the relational model(although you can store audio and video in relational database,
it is adviced not to store in the relational database).
• In this model, two are more objects are connected through links. We use this link
to relate one object to other objects. This can be understood by the example given
below.
Object Relation Model
• As the name suggests it is a combination of both the relational model and the
object-oriented model. This model was built to fill the gap between object-
oriented model and the relational model.
• We can have many advanced features like we can make complex data types
according to our requirements using the existing data types. The problem with this
model is that this can get complex and difficult to handle.
Flat Model
• It is a simple model in which the database is represented as a table
consisting of rows and columns. To access any data, the computer has
to read the entire table. This makes the modes slow and inefficient.
Context Data Model
• Context Data Model is a collection of several models. This consists of models like
network model, relational models etc. Using this model we can do various types
of tasks which are not possible using any model alone.
Data models
• Data Model gives us an idea that how the final system will look like after its
complete implementation. It defines the data elements and the relationships between
the data elements.
• Data Models are used to show how data is stored, connected, accessed and updated
in the database management system. Here, we use a set of symbols and text to
represent the information so that members of the organisation can communicate and
understand it.
• Though there are many data models being used nowadays but the Relational model
is the most widely used model.
• DBMS allows a user to specify the data to be stored in terms of a data model.
A data model is a collection of higher level data description constraints that hides
lower level storage details. It is the collection of concepts that can be used to
describe the structure of a database.
Types of Data models
1.Hierarchical Model
2.Network Model
3.Entity-Relationship Model
4.Relational Model
5.Object-Oriented Data Model
6.Object-Relational Data Model
7.Flat Data Model
8.Context Data Model
Hierarchical Model
• Hierarchical Model was the first DBMS model. This model organises the data in
the hierarchical tree structure.
• The hierarchy starts from the root which has root data and then it expands in the
form of a tree adding child node to the parent node.
• This model easily represents some of the real-world relationships like food
recipes, sitemap of a website etc.
• Example: We can represent the relationship between the shoes
present on a shopping website in the following way:
• Features of a Hierarchical Model
• One-to-many relationship: The data here is organised in a tree-like structure
where the one-to-many relationship is between the datatypes. Also, there can be
only one path from parent to any node. Example: In the above example, if we
want to go to the node sneakers we only have one path to reach there i.e through
men's shoes node.
• Parent-Child Relationship: Each child node has a parent node but a parent node
can have more than one child node. Multiple parents are not allowed.
• Deletion Problem: If a parent node is deleted then the child node is automatically
deleted.
• Pointers: Pointers are used to link the parent node with the child node and are
used to navigate between the stored data. Example: In the above example the
'shoes' node points to the two other nodes 'women shoes' node and 'men's shoes'
node.
Network model
• This model is an extension of the hierarchical model. It was the most popular
model before the relational model. This model is the same as the hierarchical
model, the only difference is that a record can have more than one parent. It
replaces the hierarchical tree with a graph.
• Example: In the example below we can see that node student has two parents i.e.
CSE Department and Library. This was earlier not possible in the hierarchical
model.
Entity Relationship model
• Entity-Relationship Model or simply ER Model is a high-level data model
diagram. In this model, we represent the real-world problem in the pictorial form
to make it easy for the stakeholders to understand. It is also very easy for the
developers to understand the system by just looking at the ER diagram. We use the
ER diagram as a visual tool to represent an ER Model.
• ER diagram has the following three components:

• Entities: Entity is a real-world thing. It can be a person, place, or even a concept.


Example: Teachers, Students, Course, Building, Department, etc are some of the
entities of a School Management System.
• Attributes: An entity contains a real-world property called attribute. This is the
characteristics of that attribute. Example: The entity teacher has the property like
teacher id, salary, age, etc.
• Relationship: Relationship tells how two attributes are related. Example: Teacher
works for a department.
Relation Model
• Relational Model is the most widely used model. In this model, the data is
maintained in the form of a two-dimensional table. All the information is stored in
the form of row and columns. The basic structure of a relational model is tables.
So, the tables are also called relations in the relational model. Example: In this
example, we have an Employee table.
Object Oriented Data Model
• The real-world problems are more closely represented through the object-oriented
data model. In this model, both the data and relationship are present in a single
structure known as an object.
• We can store audio, video, images, etc in the database which was not possible in
the relational model(although you can store audio and video in relational database,
it is adviced not to store in the relational database).
• In this model, two are more objects are connected through links. We use this link
to relate one object to other objects. This can be understood by the example given
below.
Object Relation Model
• As the name suggests it is a combination of both the relational model and the
object-oriented model. This model was built to fill the gap between object-
oriented model and the relational model.
• We can have many advanced features like we can make complex data types
according to our requirements using the existing data types. The problem with this
model is that this can get complex and difficult to handle.
Flat Model
• It is a simple model in which the database is represented as a table
consisting of rows and columns. To access any data, the computer has
to read the entire table. This makes the modes slow and inefficient.
Context Data Model
• Context Data Model is a collection of several models. This consists of models like
network model, relational models etc. Using this model we can do various types
of tasks which are not possible using any model alone.
Data model Schema and Instance
• The data which is stored in the database at a particular moment of time is called
an instance of the database.
• The overall design of a database is called schema.
• A database schema is the skeleton structure of the database. It represents the
logical view of the entire database.
• A schema contains schema objects like table, foreign key, primary key, views,
columns, data types, stored procedure, etc.
• A database schema can be represented by using the visual diagram. That diagram
shows the database objects and relationship with each other.
• A database schema is designed by the database designers to help programmers
whose software will interact with the database. The process of database creation is
called data modeling.
A schema diagram can display only some aspects of a
schema like the name of record type, data type, and
constraints. Other aspects can't be specified through
the schema diagram. For example, the given figure
neither show the data type of each data item nor the
relationship among various files.

In the database, actual data changes quite frequently.


For example, in the given figure, the database
changes whenever we add a new grade or add a
student. The data at a particular moment of time is
called the instance of the database.
Example –
Let’s say a table teacher in our database name school,
the teacher table require the name, dob, doj in their
table so we design a structure as :

Teacher table
name: String
doj: date
dob: date
DBMS Architecture
• The DBMS design depends upon its architecture. The basic client/server
architecture is used to deal with a large number of PCs, web servers, database
servers and other components that are connected with networks.
• The client/server architecture consists of many PCs and a workstation which are
connected via the network.
• DBMS architecture depends upon how users are connected to the database to get
their request done.
• Database architecture can be seen as a single tier or multi-tier. But logically,
database architecture is of two types like:
• 2-tier architecture and 3-tier architecture.

• 1-Tier Architecture
• In this architecture, the database is directly available to the user. It means the user
can directly sit on the DBMS and uses it.
• Any changes done here will directly be done on the database itself. It doesn't
provide a handy tool for end users.
• The 1-Tier architecture is used for development of the local application, where
programmers can directly communicate with the database for the quick response.
• 2-Tier Architecture
• The 2-Tier architecture is same as basic client-server. In the two-tier architecture,
applications on the client end can directly communicate with the database at the
server side. For this interaction, API's like: ODBC, JDBC are used.
• The user interfaces and application programs are run on the client-side.
• The server side is responsible to provide the functionalities like: query processing
and transaction management.
• To communicate with the DBMS, client-side application establishes a connection
with the server side.
• 3-Tier Architecture
• The 3-Tier architecture contains another layer between the client and server. In
this architecture, client can't directly communicate with the server.
• The application on the client-end interacts with an application server which
further communicates with the database system.
• End user has no idea about the existence of the database beyond the application
server. The database also has no idea about any other user beyond the application.
• The 3-Tier architecture is used in case of large web application.
Three Schema Architecture
• The three schema architecture is also called ANSI/SPARC architecture or three-
level architecture.
• This framework is used to describe the structure of a specific database system.
• The three schema architecture is also used to separate the user applications and
physical database.
• The three schema architecture contains three-levels. It breaks the database down
into three different categories.
• In the above diagram:
• It shows the DBMS architecture.
• Mapping is used to transform the request and response between
various database levels of architecture.
• Mapping is not good for small DBMS because it takes more time.
• In External / Conceptual mapping, it is necessary to transform the
request from external level to conceptual schema.
• In Conceptual / Internal mapping, DBMS transform the request from
the conceptual to internal level.
Objectives of Three schema Architecture
• The main objective of three level architecture is to enable multiple users to access the same
data with a personalized view while storing the underlying data only once. Thus it separates
the user's view from the physical structure of the database. This separation is desirable for the
following reasons:

• Different users need different views of the same data.


• The approach in which a particular user needs to see the data may change over time.
• The users of the database should not worry about the physical implementation and internal
workings of the database such as data compression and encryption techniques, hashing,
optimization of the internal structures etc.
• All users should be able to access the same data according to their requirements.
• DBA should be able to change the conceptual structure of the database without affecting the
user's
• Internal structure of the database should be unaffected by changes to physical aspects of the
storage.
Internal Level •The internal level has an internal schema which describes the
physical storage structure of the database.
•The internal schema is also known as a physical schema.
•It uses the physical data model. It is used to define that how the data
will be stored in a block.
•Internal Level: The internal level involves how the database is
physically represented on the computer system. It describes how the
data is actually stored in the database and on the computer hardware.
•The physical level is used to describe complex low-level data
structures in detail.
The internal level is generally is concerned with the following
activities:
•Storage space allocations.
For Example: B-Trees, Hashing etc.
•Access paths.
For Example: Specification of primary and secondary keys, indexes,
pointers and sequencing.
•Data compression and encryption techniques.
•Optimization of internal structures.
•Representation of stored fields.
Conceptual Level

•The conceptual schema describes the design of a


database at the conceptual level. Conceptual level is also
known as logical level.
•The conceptual schema describes the structure of the
whole database.
•The conceptual level describes what data are to be
stored in the database and also describes what
relationship exists among those data.
•In the conceptual level, internal details such as an
implementation of the data structure are hidden.
•Programmers and database administrators work at this
level.
• It describes how the database appears to the users
conceptually and the relationships between various data
tables. The conceptual level does not care for how the
data in the database is actually stored.
External Level
• At the external level, a database contains several schemas that sometimes called
as subschema. The subschema is used to describe the different view of the
database.
• An external schema is also known as view schema.
• Each view schema describes the database part that a particular user group is
interested and hides the remaining database from that user group.
• The view schema describes the end user interaction with database systems.
Data Independence
• Data independence can be explained using the three-schema architecture.
• Data independence refers characteristic of being able to modify the schema at one
level of the database system without altering the schema at the next higher level.
• There are two types of data independence:
• 1. Logical Data Independence
• 2. Physical Data Independence
Logical Data Independence
• Logical data independence refers characteristic of being able to change the
conceptual schema without having to change the external schema.
• Logical data independence is used to separate the external level from the
conceptual view.
• If we do any changes in the conceptual view of the data, then the user view of the
data would not be affected.
• Logical data independence occurs at the user interface level.
Physical Data Independence
• Physical data independence can be defined as the capacity to change the internal
schema without having to change the conceptual schema.
• If we do any changes in the storage size of the database system server, then the
Conceptual structure of the database will not be affected.
• Physical data independence is used to separate conceptual levels from the internal
levels.
• Physical data independence occurs at the logical interface level.

You might also like