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

Lecture 5 - Database Architecture & Schema

This is a Power point File that consist of Database Course Details and content. This File will help you enhance your knowledge and get an in-depth view of what Database is and why is it necessary to use it now a days.

Uploaded by

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

Lecture 5 - Database Architecture & Schema

This is a Power point File that consist of Database Course Details and content. This File will help you enhance your knowledge and get an in-depth view of what Database is and why is it necessary to use it now a days.

Uploaded by

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

DATABASE ARCHITECTURE AND

SCHEMA
HIRA FAYYAZ
LECTURE 5
2
Database Architecture

• The DBMS design depends upon its architecture.

• DBMS architecture depends upon how users are connected to the database to get
their request done.

• The style and method of designing and construction.

• 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.
Database Architecture (cont.)

• A Database Management system can be


• centralized(all the data stored at one location),
• decentralized(multiple copies of database at different
locations)
• hierarchical, depending upon its architecture.
Types of DBMS Architecture

DBMS
Architectur
e

1- Tier 2 –Tier 3 Tier


1-Tier Architecture

One Tier application AKA Standalone application


1-Tier Architecture

• In this type of architecture, the database is readily available on


the client machine, any request made by client doesn’t require a
network connection to perform the action on the database.
• 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.
1-Tier Architecture

• For example, lets say you want to fetch the records of employee
from the database and the database is available on your computer
system, so the request to fetch employee details will be done by
your computer and the records will be fetched from the database
by your computer as well. This type of system is generally referred
as local database system.
• Microsoft Excel
ADVANTAGES AND DISADVANTAGES OF 1 9
TIERARCHITECTURE

• ADVANTAGES:
• Easy to optimize performance.
• No context switching
• DISADVANTAGES:
• Not scalable
• Hard to modify.
2-Tier Architecture

Two Tier application AKA Client-Server application


2-Tier Architecture 11
2-Tier Architecture 12

• In two-tier architecture, the Database system is present at the


server machine and the DBMS application is present at the
client machine, these two machines are connected with each
other through a reliable network as shown in the above diagram.
• Whenever client machine makes a request to access the
database present at server using a query language like sql, the
server perform the request on the database and returns the
result back to the client.
• The server side is responsible to provide the functionalities like:
query processing and transaction management.
2-Tier Architecture
3-Tier Architecture

Three Tier application AKA Web Based application


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
3-Tier Architecture
Three-tier client-server
architecture
3-Tier Architecture
Database Schema 22
Database Schema 23
• 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.
Database Schema 24

• 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.
• The database schema changes very infrequently.
• The database state changes every time the database is
updated.

• Schema is also called intension.


• State is also called extension.
ANSI – 3 Level Architecture 25
DBMS Schemas
DBMS Schemas & Architecture
Three-Schema Architecture
(cont.)
• Defines DBMS schemas at three levels:
– Internal schema/ at the internal level to describe
physical storage structures and access paths (e.g
indexes).
– it is expressed how data is stored in blocks of storage.
• Typically uses a physical data model.
– Conceptual schema at the conceptual level to
describe the structure and constraints for the whole
database for a community of users. Uses an
implementation (or a conceptual) data model.
– External schemas at the external level to describe
the various user views.
• Usually uses the same data model as the conceptual schema.
Three schema Architecture

• ANSI - American National • A three-level


Standards Institute architecture
• SPARC - Standards • Internal level: For
Planning and systems designers
Requirements Committee • Conceptual level: For
database designers and
• 1975 - proposed a
administrators
framework for DBs • External level: For
database users
ANSI/SPARC Architecture
User 1 User 2 User 3
ANSI SPARC 3 levels architecture :
• External level: The way users perceive External External
the data. View 1 View 2

• Conceptual level: For database Conceptual DBA


designers and administrators View

• Internal level: The way the DBMS and


the operating system perceive the data, Stored
where the data is actually stored using Data
the data structures and file
organizations
Internal Level

• Internal
Deals with
Schema
physical storage of data
RECORD EMPof records on disk - files, pages, blocks
• Structure
LENGTH=44
• Indexes and ordering of records
HEADER: BYTE(5)
• Used by database system programmers
OFFSET=0
NAME: BYTE(25)
OFFSET=5
SALARY: FULLWORD
OFFSET=30
DEPT: BYTE(10)
OFFSET=34
Conceptual Level

• Conceptual
Deals with the
Schema
organisation of the data as a whole
• Abstractions
CREATE TABLE are used to remove unnecessary details of the internal
level
Employee (
• Name
Used by DBAs and application programmers
VARCHAR(25),
Salary REAL,
Dept_Name
VARCHAR(10))
External Level

• External
Provides Schemas
a view of the database tailored to a user
• Parts of the data may be hidden
Payroll:
• String
Data is presented
Name in a useful form
• double
Used bySalary
end users and application programmers

Personnel:
char *Name
char *Department
Database Architecture 34
External view (Level, Schema or Model):
• In the diagram below same data record is displayed in two
entirely different ways.
Database Architecture 35
Conceptual or Logical View:
(Example)
Database Architecture 36
Internal: (Example)
37
Continued…

continue…
Sales Officer Inventory Controller
View 1 View 2
External Item_Name Item_Name
Level Price Stock

Conceptual
Conceptual Item_Number Character (6)
Item_Name Character(30)
Level Price Numeric(5,2)
Stock Numeric(4)

Physical
Stored_Item Length=50
Physical Item # Type = Byte(6), offset = 0, Index = Ix
Name Type = Byte(30), offset = 6
Level Price Type = Byte(8), offset = 36
Stock Type = Byte(4), offset = 44
Schemas and Instances
• Database Schema: The overall description of the database is
called the database schema. Similar to types and variables in
programming languages.
1. External Schema: At the highest level, we have multiple external
schemas that correspond to different views of the data.
2. Conceptual Schema: the overall logical structure of the database,
describes all the entities, attributes, and relationships together with
integrity constraints.
Example: The database consists of information about a set of
customers and accounts in a bank and the relationship between them
3. Internal schema: the overall physical structure of the database,
containing the definitions of stored records, the methods of representation, the
data fields, and the indexes and storage structures used.
• Instance – the actual content of the database at a particular
point in time
• Analogous to the value of a variable
40
Mappings

• Physical
Mappingsdata
translate
independence
information from one level to the next
• Changes
External/Conceptual
to internal level shouldn’t affect conceptual level
• Conceptual/Internal
• Logical data independence
• These mappings
• Conceptual level provide data independence
changes shouldn’t affect external levels
Reading
Material 42
Book Chapter Sections / Pages

Ref. Book B 1 Chapter 2

Introduction to Database Systems 09/10/2024


Useful Links 47

• https://www.slideshare.net/shahab3/database-systems-cha
pter-2
• http://grail.cba.csuohio.edu/~matos/notes/cis-610/6th-Editi
on/Slides/Elmasri_6e_Ch02_Handout.pdf

• http://cezeife.myweb.cs.uwindsor.ca/courses/60-315/notes/
ch2.pdf
• https://www.slideshare.net/philipsinter/database-system-38
795643

You might also like