0% found this document useful (0 votes)
7 views47 pages

Three Level Architecture

The document discusses various database architectures, including 1-Tier, 2-Tier, and 3-Tier architectures, highlighting their characteristics and use cases. It also covers the concept of database schema, which defines the structure and organization of data within a database, and the ANSI/SPARC three-level architecture that separates the internal, conceptual, and external views of data. Additionally, it addresses the advantages and disadvantages of different architectures and the importance of data independence in database management systems.

Uploaded by

kclsylvite
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views47 pages

Three Level Architecture

The document discusses various database architectures, including 1-Tier, 2-Tier, and 3-Tier architectures, highlighting their characteristics and use cases. It also covers the concept of database schema, which defines the structure and organization of data within a database, and the ANSI/SPARC three-level architecture that separates the internal, conceptual, and external views of data. Additionally, it addresses the advantages and disadvantages of different architectures and the importance of data independence in database management systems.

Uploaded by

kclsylvite
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 47

Three Level Architecture

Database Architecture and


Schema

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.
5
File-Server Architecture
• File server

• A computer attached to a network with the primary purpose of providing shared


storage for computer files such as documents, spreadsheets, images, and databases.

6
File-Server Architecture
• In a file-server environment, the processing is distributed about the network, typically
a local area network (LAN).

The file-server holds the files required by the applications and the DBMS. However, the
applications and the DBMS run on each workstation, requesting files from the file-server
when necessary

7
8
File-Server Architecture
• As the file-server has no knowledge of SQL, the DBMS must request the files
corresponding to the Branch and Staff relations from the file-server, rather than just
the staff names that satisfy the query.
• The file-server architecture, therefore, has three main disadvantages:
• (1) There is a large amount of network traffic.
• (2) A full copy of the DBMS is required on each workstation.
• (3) Concurrency, recovery, and integrity control are more complex, because there can
be multiple DBMSs accessing the same files.

9
Types of DBMS Architecture

DBMS
Architecture

1- Tier 2 –Tier 3 Tier


1-Tier Architecture

One Tier application As Known As 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
TIERARCHITECTURE

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

14
2-Tier Architecture

Two Tier application Also Known As Client-Server application


2-Tier Architecture

16
2-Tier Architecture
• 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.
• 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.

17
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 application.
3-Tier Architecture
Three-tier client-server architecture
3-Tier Architecture
Database Schema

27
Database Schema
• 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.

28
Database Schema
• 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.

29
ANSI – 3 Level Architecture

30
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 architecture


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

• External level: The way users perceive the data. External External
View 1 View 2

• Conceptual level: For database designers and


administrators Conceptual DBA
View

• Internal level: The way the DBMS and the


operating system perceive the data, where the
data is actually stored using the data structures Stored
and file organizations Data
Internal Level
• Deals with physical storage of • Internal Schema
data RECORD EMP
LENGTH=44
• Structure of records on disk - files, HEADER: BYTE(5)
pages, blocks OFFSET=0
• Indexes and ordering of records NAME: BYTE(25)
OFFSET=5
• Used by database system SALARY: FULLWORD
programmers OFFSET=30
DEPT: BYTE(10)
OFFSET=34
Conceptual Level
• Deals with the organisation of • Conceptual Schema
the data as a whole CREATE TABLE
• Abstractions are used to remove Employee (
unnecessary details of the internal
level Name
• Used by DBAs and application VARCHAR(25),
programmers Salary REAL,
Dept_Name
VARCHAR(10))
External Level
• Provides a view of the database • External Schemas
tailored to a user Payroll:
• Parts of the data may be hidden String Name
• Data is presented in a useful form double Salary
• Used by end users and application
programmers
Personnel:
char *Name
char *Department
Database Architecture
External view (Level, Schema or Model):
• In the diagram below same data record is displayed in two entirely different ways.

39
Database Architecture
Conceptual or Logical View: (Example)

40
Database Architecture
Internal: (Example)

41
42
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
45
Mappings
• Mappings translate information • Physical data independence
from one level to the next • Changes to internal level shouldn’t
• External/Conceptual affect conceptual level
• Conceptual/Internal • Logical data independence
• These mappings provide data • Conceptual level changes shouldn’t
independence affect external levels
Useful Links
• https://www.slideshare.net/shahab3/database-systems-chapter-2
• http://grail.cba.csuohio.edu/~matos/notes/cis-610/6th-
Edition/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-38795643

51

You might also like