0% found this document useful (0 votes)
146 views13 pages

DBMS Architechture

The document discusses database architecture and concepts. It describes two common types of database architecture - two-tier and three-tier client/server architectures. Two-tier architecture has the user interface and application programs running on the client side and connecting to the database management system (DBMS) via ODBC. Three-tier architecture adds an intermediate application server layer between the client and database for web applications. The document also defines key database concepts like data models, schemas, instances, and data independence.

Uploaded by

Aditya Pratap
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)
146 views13 pages

DBMS Architechture

The document discusses database architecture and concepts. It describes two common types of database architecture - two-tier and three-tier client/server architectures. Two-tier architecture has the user interface and application programs running on the client side and connecting to the database management system (DBMS) via ODBC. Three-tier architecture adds an intermediate application server layer between the client and database for web applications. The document also defines key database concepts like data models, schemas, instances, and data independence.

Uploaded by

Aditya Pratap
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/ 13

Database Architecture

Database architecture is logically divided into two types.

1. Logical two-tier Client / Server architecture


2. Logical three-tier Client / Server architecture

Two-tier Client / Server Architecture

Two-tier Client / Server architecture is used for User Interface program and Application
Programs that runs on client side. An interface called ODBC(Open Database Connectivity)
provides an API that allow client side program to call the dbms. Most DBMS vendors
provide ODBC drivers. A client program may connect to several DBMS's. In this
architecture some variation of client is also possible for example in some DBMS's more
functionality is transferred to the client including data dictionary, optimization etc. Such
clients are called Data server.
Three-tier Client / Server Architecture

Three-tier Client / Server database architecture is commonly used architecture for web
applications. Intermediate layer called Application server or Web Server stores the web
connectivty software and the business logic(constraints) part of application used to access
the right amount of data from the database server. This layer acts like medium for sending
partially processed data between the database server and the client.

Data Models, Schemas, and Instances


One fundamental characteristic of the database approach is that it provides some level of
data abstraction.
Data abstraction generally refers to the suppression of details of data organization and
storage, and the highlighting of the essential features for an improved understanding of
data. One of the main characteristics of the database approach is to support data
abstraction so that different users can perceive data at their preferred level of detail.
A Data Model is a logical structure of Database. It describes the design of
database to reflect entities, attributes, relationship among data, constrains etc.
TypesofDataModels:
Object based logical Models – Describe data at the conceptual and view levels.
Record based logical Models – Like Object based model, they also describe data
at the conceptual and view levels. These models specify logical structure of
database with records, fields and attributes.
A data model—a collection of concepts that can be used to describe the structure of a
database—provides the necessary means to achieve this abstraction. By structure of a
database we mean the data types, relationships, and constraints that apply to the data.
Most data models also include a set of basic operations for specifying retrievals and
updates on the database.
Many data models have been proposed, which we can categorize according to the types of
concepts they use to describe the database structure.
High-level or conceptual data models provide concepts that are close to the way many
users per-ceive data
Low-level or physical data models provide concepts that describe the details of how data
is stored on the computer storage media, typically magnetic disks. Concepts provided by
low-level data models are generally meant for computer specialists, not for end users.
Between these two extremes is a class of representational (or implementation) data
models, which provide concepts that may be easily understood by end users but that are
not too far removed from the way data is organized in computer storage. Representational
data models hide many details of data storage on disk but can be implemented on a
computer system directly.
Conceptual data models use concepts such as entities, attributes, and relationships.
An entity represents a real-world object or concept, such as an employee or a project from
the mini world that is described in the database.
An attribute represents some property of interest that further describes an entity, such as
the employee’s name or salary.
A relationship among two or more entities represents an association among the entities, for
example, a works-on relationship between an employee and a project.
Physical data models describe how data is stored as files in the computer by representing
information such as record formats, record orderings, and access paths.
These models describe data at the lowest level of abstraction.
An access path is a structure that makes the search for particular database records
efficient.
Historically, in database design, three models are commonly used. They are,

• Hierarchical Model
• Network Model
• Relational Model

Hierarchical Model
In this model each entity has only one parent but can have several children . At the top of
hierarchy there is only one entity which is called Root.
Network Model
In the network model, entities are organised in a graph,in which some entities can be
accessed through several path

Relational Model
In this model, data is organised in two-dimesional tables called relations. The tables or
relation are
related to
each other.
Schemas
Definition of schema: Design of a database is called the schema. Schema is of
three types:
Physical schema,
logical schema and
view schema.
A database schema is a description of the database, its structure and its constraints. A
database schema does not change with time frequently. Once defined it remains so
till the database structure is altered or constraints are added / removed. Schema is also
called intension
The design of a database at physical level is called physical schema, how the
data stored in blocks of storage is described at this level.
Design of database at logical level is called logical schema, programmers and
database administrators work at this level, at this level data can be described as
certain types of data records gets stored in data structures, however the internal
details such as implementation of data structure is hidden at this level (available
at physical level).
Design of database at view level is called view schema. This generally
describes end user interaction with database systems.

The Three-Schema Architecture


The goal of the three-schema architecture, illustrated in Figure 2.2, is to separate the user
applications from the physical database. In this architecture, schemas can be defined at the
following three levels:
The internal level has an internal schema, which describes the physical stor-age
structure of the database. The internal schema uses a physical data model and describes
the complete details of data storage and access paths for the database.
The conceptual level has a conceptual schema, which describes the structure of the
whole database for a community of users. The conceptual schema hides the details of
physical storage structures and concentrates on describing entities, data types,
relationships, user operations, and constraints. Usually, a representational data model is
used to describe the conceptual schema when a database system is implemented.
This implementation conceptual schema is often based on a conceptual schema design in a
high-level data model.

The external or view level includes a number of external schemas or user views.
Each external schema describes the part of the database that a particular user group is
interested in and hides the rest of the database from that user group. As in the previous
level, each external schema is typically implemented using a representational data model,
possibly based on an external schema design in a high-level data model.
Instances
Definition of instance:: The data stored in database at a particular moment of
time is called instance of database. Database schema defines the variable
declarations in tables that belong to a particular database; the value of these
variables at a moment of time is called the instance of that database.
Instance of the database, also known as the database state, is the actual data available
/ stored in the database at a particular point of time. Instance is also called extension.
The database instance / state changes every time the database is updated.
STATES
The distinction between database schema and database state is very important. When
we define a new database, we specify its database schema only to the DBMS.
At this point, the corresponding database state is the empty state with no data.
We get the initial state of the database when the database is first populated
or loaded with the initial data.
From then on, every time an update operation is applied to the database, we get another
database state. At any point in time, the database has a current state.
The DBMS is partly responsible for ensuring that every state of the database is a valid
state—that is, a state that satisfies the structure and constraints specified in the schema.
Hence, specifying a correct schema to the DBMS is extremely important and the schema
must be designed with utmost care.
The DBMS stores the descriptions of the schema constructs and constraints—also called
the meta-data—in the DBMS catalog so that DBMS software can refer to the schema
whenever it needs to.
The schema is sometimes called the intension, and a database state is called
an extension of the schema.

Data independence
The ability to modify a schema definition in one level without affecting a schema definition
in the next higher level is called Data Independence.
It is independence between the programs and thedata.

Logical Data Independence


Logical data is data about database, that is, it stores information about how data is
managed inside. For example, a table (relation) stored in the database and all its
constraints, applied on that relation.

Logical data independence is a kind of mechanism, which liberalizes itself from actual data
stored on the disk. If we do some changes on table format, it should not change the data
residing on the disk.
Physical Data Independence
All the schemas are logical, and the 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, in case we want to change or upgrade the storage system itself − suppose
we want to replace hard-disks with SSD − it should not have any impact on the logical data
or schemas.

Database Languages and Interfaces


Database languages are used for read, update and store data in a database. There are
several such languages that can be used for this purpose; one of them is SQL (Structured
Query Language).
Data Definition Language (DDL): DDL is used for specifying the database schema. Let’s
take SQL for instance to categorize the statements that comes under DDL.
• To create the database instance – CREATE
• To alter the structure of database – ALTER
• To drop database instances – DROP
• To delete tables in a database instance – TRUNCATE
• To rename database instances – RENAME
All these commands specify or update the database schema that’s why they come under
Data Definition language.
Data Manipulation Language (DML): DML is used for accessing and manipulating data in
a database.
Manipulation includes:
retrieval (querying the DB),
inserting records,
deleting records,
Changing data already entered
• SELECT – It retrieves data from a database
• INSERT – It inserts data into a table
• UPDATE – It updates existing data within a table
• DELETE – It deletes all records from a table, the space for the records remain
• MERGE – UPSERT operation (insert or update)
Data Control Language
The Data Control Language (DCL) is used to control privilege in Database. To perform any
operation in the database, such as for creating tables, sequences or views we need
privileges.
Privileges are of two types,
• System – creating a session, table etc are all types of system privilege.
• Object – any command or query to work on tables comes under object privilege.
DCL is used to define two commands. These are:
• Grant – It gives user access privileges to a database.
• Revoke – It takes back permissions from the user.
Transaction Control Language (TCL)
Transaction Control statements are used to run the changes made by DML statements. It
allows statements to be grouped together into logical transactions.
• COMMIT – It saves the work done
• SAVEPOINT – It identifies a point in a transaction to which you can later roll back
• ROLLBACK – It restores database to original since the last COMMIT

Interfaces
Forms-Based Interfaces. A forms-based interface displays a form to each user. Users can
fill out all of the form entries to insert new data, or they can fill out only certain entries, in
which case the DBMS will retrieve matching data for the remaining entries.
Graphical User Interfaces. A GUI typically displays a schema to the user in diagrammatic
form. The user then can specify a query by manipulating the diagram. In many cases, GUIs
utilize both menus and forms. Most GUIs use a pointing device, such as a mouse, to
select certain parts of the displayed schema diagram.

Natural Language Interfaces. These interfaces accept requests written in English or some
other language and attempt to understand them. A natural language interface usually has
its own schema, which is similar to the database conceptual schema, as well as a dictionary
of important words. The natural language interface refers to the words in its schema, as well
as to the set of standard words in its dictionary, to interpret the request. If the interpretation
is successful, the inter-face generates a high-level query corresponding to the natural
language request and submits it to the DBMS for processing; otherwise, a dialogue is
started with the user to clarify the request. The capabilities of natural language interfaces
have not advanced rapidly.

Speech Input and Output. Limited use of speech as an input query and speech as an
answer to a question or result of a request is becoming commonplace. Applications with
limited vocabularies such as inquiries for telephone directory, flight arrival/departure, and
credit card account information are allowing speech for input and output to enable
customers to access this information. The speech input is detected using a library of
predefined words and used to set up the parameters that are supplied to the queries. For
output, a similar conversion from text or numbers into speech takes place.

Interfaces for Parametric Users. Parametric users, such as bank tellers, often have a
small set of operations that they must perform repeatedly. For example, a teller is able to
use single function keys to invoke routine and repetitive transactions such as account
deposits or withdrawals, or balance inquiries. Systems analysts and programmers design
and implement a special interface for each known class of naive users.

Interfaces for the DBA. Most database systems contain privileged commands that can be
used only by the DBA staff. These include commands for creating accounts, setting system
parameters, granting account authorization, changing a schema, and reorganizing the
storage structures of a database.
Overall Structure of DBMS

DBMS acts as an interface between user and the database. DBMS are very large and
typically divided into modules :-

DDL Compiler - Converts DDL statements to a set of tables containing metadata stored in
a data dictionary.Metadata information can be the name of files,data items,storage details of
each file,mapping information and constraints,etc.
DML Compiler and Query Optimizer - DML compiler translates the Data Manipulation
Languages into query

Engine instructions. It might also do optimization for query.


Query processor/optimizer translates statements in a query language into low-level
instructions the database manager understands. (It is used to find an equivalent but more
efficient form).

Data Manager - The data manager is the central software component of the DBMS. It is
sometimes referred to as the database control system.
One of the functions of the data manager is to convert operations in the user's queries
coming directly via the query processor or\ indirectly via an application program from the
user's logical view to a physical file system.
The data manager is responsible for interfacing with the file system as show. In addition, the
tasks of enforcing constraints to maintain the consistency and integrity of the data, as well
as its security, are also performed by the data manager.
It is also the responsibility of the Data. Manager to provide the synchronization in the
simultaneous operations performed by concurrent users and to maintain the backup and
recovery operations.

Data Dictionary - Data Dictionary is a repository of description of data in the database.A


data dictionary contains a list of all files in the database, the number of records in each file
and the names and types of each field. Most database management systems keep the data
dictionary hidden from users to prevent them from accidentally destroying its content.

Functions of the Data Dictionary-


1. Defines the data element.
2. Helps in the scheduling.
3. Helps in the control.
4. Permits the various users who know which data is available and how can it be obtained.
5. Helps in the identification of the organizational data irregularity.
6. Acts as a very essential data management tool.
7. Provides with a good standardization mechanism.
8. Acts as the corporate glossary of the ever growing information resource.
9. Provides the report facility, the control facility along with the excerpt facility.

Data Files - It stores the database.

Compiled DML - The DML complier converts the high level Queries into low level file
access commands known as compiled DML.

End Users - End Users are the people who interact with the database through applications
or utilities. The various categories of end users are:

1. Casual End Users - These Users occasionally access the database but may need
different information each time. They use sophisticated database Query language to specify
their requests. For example: High level Managers who access the data weekly or biweekly.

2. Native End Users - These users frequently query and update the database using
standard types of Queries. The operations that can be performed by this class of users are
very limited and effect precise portion of the database. For example: - Reservation clerks for
airlines/hotels check availability for given request and make reservations. Also, persons
using Automated Teller Machines (ATM's) fall under this category as he has access to
limited portion of the database.

3. Standalone end Users/On-line End Users - Those end Users who interact with the
database directly via on-line terminal or indirectly through Menu or graphics based
Interfaces. Example:-Library Management System.

You might also like