Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

ITE 2422 – Database Management Systems Week 01

2.0 Database System Concepts and Architectures

Introduction

This is the second lesson you would be learning for the “Database Management
Systems” module. This lesson provides you with a broad coverage of the concepts of
the Database Systems and its architectures. Since you are already able to describe a
database and database management system (DBMS), now it is essential to know the
concepts in database systems and architectures before starting to design and develop
databases.

Let us start the lesson 2.

Learning outcomes

After completing this lesson, you will be able to describe and differentiate different
types of data models, data independence and types of DBMS architectures.

From this lesson you will be able to,


• Differentiate various types of data models
• Explain three schema architecture
• Interpret schema and instance
• Explain data independence
• Describe centralized, decentralized and client server architectures

For businesses, data is a very important resource. In fact, data is the new ‘gold’.
With the huge amount of data getting created today, there are so many ways to
handle and use it.
Thus, it is important the know the role of the data models (e.g. network, relational
data models) and different architectures available to work with.

Database System Concepts and Architectures 1/13


ITE 2422 – Database Management Systems Week 01

So, how do you make the right choice?

As database designers or admins, it is important to pick the right model and the
architecture appropriate for the requirements.

1.1 Data models


A DBMS allows a user to define the data to be stored in terms of a data model. A data
model is a collection of concepts for describing data. Data models define how the
logical structure of a database is modelled, including the relationships and constraints
that determine how data can be stored and accessed. That is, it defines how data is
connected to each other and how they are processed and stored inside the system.

There are different types of data models. Most of the DBMS are built targeting a
particular data model and require users to adopt that model. In addition, different
models apply to different stages of the database design process.

Some of the popular data models are given below:


• Hierarchical data model
This organises data into a tree like structure (Figure 1), with a single root, to
which all the other data is linked. In this model, data is organized with one-to-
many relationship between two different types of data. That is, a child node
will only have a single parent node. For example, one department can have
many courses, teachers and students.

Database System Concepts and Architectures 2/13


ITE 2422 – Database Management Systems Week 01

Figure 1: Hierarchical data model


(Courtesy: https://www.studytonight.com/dbms/database-model.php)

• Network model
This is an extension of the Hierarchical model. In this model, data is organised
like a graph (Figure 2). This data model allows to map many-to-many data
relationships. That is, one child can connect to more than one parent node.

Seller

Employee Customer Product

Sales
Order

Figure 2: Network data model

This was the most widely used database model, before Relational Model was
introduced.

Database System Concepts and Architectures 3/13


ITE 2422 – Database Management Systems Week 01

• Entity-relationship model
This model is used to visually represent the relationship among different data
objects. It is known as the Entity-relationship (E-R) diagram (Figure 3). Usually,
this is used to design a database and later to be converted to a relational
model when implementing the database. In this data model, relationships are
created by dividing objects of interest into entities and its characteristics into
attributes. Then the different entities are related using relationships.
You will be learning about E-R diagrams and how to map an E-R diagram to a
relational model later.

Figure 3: E-R data model

• Relational model
In relational data model, there will be a table (relation) with rows and
columns. Each relation is related to another relation (Figure 4). Every relation
has a schema, which describes the columns or fields. You will be learning about
schema in the next section.
Most of the databases today are based on the relational data model. As such,
we will be learning in this module about designing and creating relational
databases.

Database System Concepts and Architectures 4/13


ITE 2422 – Database Management Systems Week 01

Figure 4: Relational data model

Do Activity 1.1, to understand the differences between various types of data models.

Activity 1.1

Identify the difference between the relational data model and the network data model.

In the next section you will learn about schema and instances.

1.2 Three-schema architecture


A schema defines how the data is organized and how the relations among them are
associated. It defines its entities and the relationship among them and it formulates
all the constraints that are to be applied on the data. Database designers design the
schema to help programmers understand the database when storing and accessing the
data.

A database schema can be divided broadly into two categories as follows:


• Physical Database Schema − This schema pertains to the actual storage of data
and its form of storage like files, indices, etc. That is, it defines how the data
will be stored in a secondary storage (in disks and tapes).

Database System Concepts and Architectures 5/13


ITE 2422 – Database Management Systems Week 01

• Logical Database Schema – Sometimes known as conceptual schema. This


schema defines all the logical constraints that need to be applied on the data
stored. It defines relations (tables) and integrity constraints.

In a relational DBMS, the conceptual schema describes all relations that are
stored in the database.

For instance, if you are asked to design a database for the university, there will be
relations that contain information about entities, such as students and courses, and
about relationships, such as students' enrollment in courses.

In fact, each collection of entities and each collection of relationships can be


described as a relation, leading to the following conceptual schema:
• Student(sid:string, name:string, login:string, age:integer, gpa:real)
• Course(cid: string, cname:string, credits:integer)
• Enrolled(sid:string, cid:string, grade: string)

A sample physical schema for the university database follows:


• Store all relations as unsorted files of records (A file in a DBMS is either a
collection of records or a collection of pages, rather than a string of
characters as in an operating system.)
• Create indexes on the first column of the Students and Courses relations.
Indexes are created to speed up data retrieval operations.

Decisions about the physical schema are based on an understanding of how the data is
typically accessed. The process of arriving at a good physical schema is called physical
database design.

Other than the conceptual and physical schema, there is an external schema (View).
The external schema design is guided by end user requirements. This is the view of
the relational database that end users see, and it involves a high level of abstraction.

Database System Concepts and Architectures 6/13


ITE 2422 – Database Management Systems Week 01

For example, we might want to allow students to find out the number of students
enrolled to a course (enrollments).
This can be done by defining the following view:
• CourseInfo(cid:string, enrollment: integer)

Views can be created as needed. We did not include CourseInfo in the conceptual
schema as Courseinfo can be created from the relations in the conceptual schema.
Otherwise, we would be duplicating the same data.

This is known as three schema architecture (Figure 5).

Figure 5: three-schema architecture


(Courtesy: https://www2.dmst.aueb.gr/dds/etech/db/abstr.htm)

The three-schema architecture which is developed in the 1970s, helps to evaluate a


relational database from different viewpoints. The three-schema architecture is

Database System Concepts and Architectures 7/13


ITE 2422 – Database Management Systems Week 01

generally attributed to the ANSI/SPARC group and is sometimes also called


"ANSI/SPARC" architecture.

This allows to separate the design maintenance from the core system maintenance.
Each of these levels can be changed internally without affecting other levels. It is
known as data independence.

1.3 Database schema Vs. database instance


We can consider the database schema as the skeleton of the database. At the
beginning (when the database does not exist) database schema is designed. Once the
database is operational, it is very difficult to make any changes to it.

However, a database schema does not contain any data or information. A database
instance is a state of operational database with data at any given time. It contains a
snapshot of the database. Thus, the database instances tend to change with time.

1.4 Data independence


As we learnt earlier, database systems are designed as multilayers (three-schema
architecture). Data independence is achieved through use of the three levels of data
abstraction. Here, applications are insulated from how the data is structured and
stored. Otherwise, it would be difficult to do the changes. If the entire data is
dependent, changes overtime to satisfy clients requirements would be a tedious and a
highly complex job.

There are two types of data independence:

• Logical data independence: Protection from changes in logical structure of


data.
Logical data is data about a database. That is, it stores information about how
data is managed inside. For example, logical data contains information about
the tables (relations) stored in the database and all the constraints applied on

Database System Concepts and Architectures 8/13


ITE 2422 – Database Management Systems Week 01

them. If we do some changes on table format, it should not change the data
residing on the disk.

• Physical data independence: Protection from changes in physical structure of


data.
Actual data is stored in bit format on the disk. Physical data independence is
the power to change the physical data without impacting the schema or logical
data. For example, if we want to change or upgrade the storage system itself
(e.g. suppose we want to replace hard-disks with SSD), it should not have any
impact on the logical data or schemas.

Do Activity 1.4, to understand the advantages of data independence.

Activity 1.4

List the advantages of data independence.

In the next section, we will be learning about the differences between centralized
and distributed databases.

1.5 Centralized, decentralized and client server architectures


Based on the location, the database is available we can classify the database systems
as follows:

• Centralized database
All the DBMS functionality, application program execution, and user interface
processing were carried out on one machine (Figure 6). For example, a
database that is located, stored, and maintained in a desktop or server CPU, or
a mainframe computer. Other machines can access via a communications
network LAN or WAN.

Database System Concepts and Architectures 9/13


ITE 2422 – Database Management Systems Week 01

Centralized database systems are used by some major banks to do all their
processing on a mainframe and airline reservation systems to avoid double
bookings.

Figure 6: Centralized database architecture

Advantages:
• Reduced redundancy - good planning can allow duplicate or similar data
stored in different files for different applications to be combined and
stored only once.
• Improved availability - information may be made available to any
application program using the DBMS.
• Reduced inconsistency - if the same data is stored in more than one
place, then updating in one place and not everywhere can lead to
inconsistencies in the database.
• Enforced data security - authorization to use information can be
centralized.

Disadvantages:
• When the central site computer or database system goes down, then
everyone (users) is blocked from using the system until the system
comes back.

Database System Concepts and Architectures 10/13


ITE 2422 – Database Management Systems Week 01

• Communication costs from the terminals to the central site can be


expensive.

• Distributed database
A single logical database that is spread physically across computers in multiple
locations that are connected by a data communications link (Figure 7). In
distributed databases, most of the processing is done locally. It needs to
consider the local ownership of data (e.g. application of region/country
specific data protection laws) when sharing data. However, the users think that
they are working with a single corporate database.
For example, chain-stores/supermarkets have their individual databases and
may be updated monthly/annually with the central system.

Figure 7: Distributed database architecture

Advantages:
• Distributed database architecture provides greater efficiency and better
performance.

Database System Concepts and Architectures 11/13


ITE 2422 – Database Management Systems Week 01

• As data volumes and transaction rates increase, users can grow the
system incrementally.
• It causes less impact on ongoing operations when adding new locations.
• Distributed database system provides local autonomy.

Disadvantage:
• Recovery from failure is more complex in distributed database systems
than in centralized systems.

• Client server architecture


Separated the database into two logical components as client (front end) and
server (back end) as shown in Figure 8. Server and client computers are
connected into a network. Generally, the clients will be personal computers or
workstations. The applications and tools of DBMS would run on one or more
client platforms and make requests for DBMS services from server. As servers,
large workstations, mini range computer system or a mainframe computer
system can be considered. DBMS software reside on the server. The DBMS, in
turn, processes these requests and returns the results to the client(s).

Figure 8: Client-server architecture


(Courtesy: https://en.wikipedia.org/wiki/Client%E2%80%93server_model)

Database System Concepts and Architectures 12/13


ITE 2422 – Database Management Systems Week 01

The client server architecture can be distinguished as two-tier architecture and


three-tier architecture.

Do Activity 1.5 to identify the difference between two-tier architecture and three-tier
architecture.

Activity 1.5

Do a search and find the difference between the two-tier architecture and three-tier
architecture. Explain the difference.

Summary
Now we have completed learning the Lesson 2. In this lesson, we discussed various
concepts in database systems.

In database systems to support the smooth maintenance of the database, data


independence is used. Thus, the changes to the logical design will not affect the
actual data stored or vice versa. There are various types of data models that can
be used in various situations. Relational model is the most commonly used data
model today. In addition, database systems can be differentiated based on the
location as centralized, decentralized and client-server architecture.

In the lesson 3, you will learn more details about components of an ER diagram.
Thus, you will be able to start database designing. Before you go to the next
lesson, complete the self-assessment Quiz 2 to check what you have learnt in
the Lesson 2.

Database System Concepts and Architectures 13/13

You might also like