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

Dbms - Introduction-1 - 1

Uploaded by

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

Dbms - Introduction-1 - 1

Uploaded by

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

DataBase Management System

What is Data?

 Data can be facts related to any any object in consideration.


 For example your name, age, height, weight etc are some data related to
you.
 A Picture,image,file,pdf etc can be considered as
data.
 For eg, consider the names, telephone numbers, and addresses of
the people you know. You may have recorded this data in an
indexed address book or you may have stored it on a hard drive,
using a personal computer and software such as Microsoft Access
or Excel.
 This collection of related data with an implicit meaning is a
database.
Chapter-1
Databases and Database users
What is a
Database?
 Database is a systematic collection of data. Databases support
storage and manipulation of data. Databases make data
management easy.
 A database is a collection of information that is organized so that it
can be easily accessed, managed and updated.
 Data is organized into rows, columns and tables, and it is indexed to
make it easier to find relevant information.
A database must have the following properties:
 It represents some aspect of the real (or an imagined) world,
called the miniworld or universe of discourse.
• Changes to the miniworld are reflected in the database.
Imagine, for example, a UNIVERSITY miniworld concerned with
students, courses, course sections, grades, and course prerequisites.

• It is a logically coherent collection of data, to which some meaning can


be attached.
• A database is designed, built, and populated with data for a specific
purpose.
• Let's discuss few examples.
• An online telephone directory would definitely use database to
store data belongs to people, phone numbers, other contact
details, etc.
• Let's also consider the facebook. It needs to store, manipulate and
present data related to members, their friends, member activities,
messages, advertisements and lot more.
• A database can be of any size and complexity.For example, the list of
names and addresses referred to earlier may consist of only a few
hundred records, each with a simple structure.

• An example of a large commercial database is Amazon.com.


 A database may be generated and maintained manually or it may be
computerized.

• For example, a library card catalog is a database that may be created and
maintained manually.
• A computerized database may be created and maintained either by a
group of application programs written specifically for that task or by a
database management system
DBMS
Def: It is a collection of programs that enables the user to
create and maintain the database.

The DBMS is a general-purpose software system that enables


the processes of defining, constructing, manipulating, and
sharing databases among various users and applications.

Defining a database involves specifying the data types,


structures, and constraints of the data to be stored in the
database. (Data Organization)

The database definition or descriptive information is also


stored by the DBMS in the form of a database catalog or
dictionary; it is called meta-data.
Constructing the database is the process of storing the data that
is controlled by the DBMS.
Manipulating a database includes functions such as querying
the database to retrieve specific data, updating the database to
reflect changes in the miniworld, and generating reports from the
data.
Sharing a database allows multiple users and programs to access
the database simultaneously.
An application program accesses the database by sending queries
or requests for data to the DBMS.
system protection: preventing database from becoming
corrupted when hardware or software failures occur.
security protection: preventing unauthorized or malicious
access to database.
Why do we use DBMS
 D B M S stands for database management system; in other
words, a system that manages databases.
 A DBMS is a computer software application that
interacts with the user, other applications, and the database
itself to capture and analyze data. A general- purpose
D B M S is designed to allow the definition, creation,
querying, update, and administration of databases.
Example of Database

 A Microsoft Excel spreadsheet or Microsoft Access are good


examples of desktop database programs.
These programs allow users to enter data, store it, protect it, and
retrieve it when needed.
They include databases like SQLServer, OracleDatabase,
Sybase, Informix, and MySQL
An Example: UNIVERSITY database
• Among the main ideas illustrated in this example is that each
file/relation/table has a set of named fields/attributes/columns, each of
which is specified to be of some data type.
• each table with data in the form of records/tuples/rows, each of which
represents some entity (in the miniworld) or some relationship between
entities.
• For example, each record in the STUDENT table represents a —
student. Similarly for the COURSE and SECTION tables. On the other
hand, each record in GRADE_REPORT represents a relationship
between a student and a section of a course. And each record in
QUALIFICATION represents a relationship between two courses.
• Database manipulation involves querying and updating. Examples of
(informal) queries:  Retrieve the of student(s) named 'Smith'.  List
the names of students who were enrolled in a section of the 'Database'
course in Spring 2006, as well as their grades in that course section.
•  List all requirements of the 'Database' course. Examples of (informal)
updates:  Change the CLASS value of 'Smith' to sophomore (i.e., 2).
•  Insert a record for a section of 'File Processing' for this semester.
Conti..
 Remove from the prerequisites of course 'CMPS 340' the
course 'CMPS 144'. Of course, a query/update must be
conveyed to the DBMS in a precise way (via the query
language of the DBMS) in order to be processed.
As with software in general, developing a new database (or a
new application for an existing database) proceeds in phases,
including requirements analysis and various levels of design
(conceptual (e.g., Entity-Relationship Modeling), logical
(e.g., relational), and physical (file structures)).
A Brief History of Database
Applications
Evolution of Databases:
Databases have evolved in the 1960s, beginning with
hierarchical and network databases, A bulk of the
worldwide database processing still occurs
using these models. In the 1980s with object-
oriented databases, and today with SQL and
NoSQL databases and cloud database
Hierarchical -

 This type of DBMS employs the "parent-


child" relationship of storing data.This type of
DBMS is rarely used nowadays. Its structure
is like a tree with nodes representing records
and branches representing fields.The windows
registry used in Windows XP is an example
of a hierarchical database.
Network D B M S

 This type of DBMS supports many-to many


relations.This usually results in complex database
structures. RDM Server is an example of a database
management system that implements the network
model.
Relational D B M S
This type of DBMS defines database relationships in
form of tables, also known as relations. Relational
DBMS usually have pre-defined data types that they can
support.
Ex- MySQL, Oracle, and Microsoft SQL Server
database.
• Relational DBMS Products emerged in the
1980s.Data on the Web and E-commerce
Applications.
• Web contains data in HTML (Hypertext
markup language) with links among pages.
• This has given rise to a new set of
applications and E-commerce is using new
Object Oriented Relation D B M S

 This type supports storage of new data types.The


data to be stored is in form of objects.
 Ex- PostgreSQL is an example of an object
oriented relational DBMS.
 Script programming languages such as
PHP and JavaScript allow generation of
dynamic Web pages that are partially
generated from a database
Applications

 Banking
 Airlines
 Manufacturing and selling
 Human resources
Uses of DBMS:
 Data that is well organized and integrated is
very useful in decision making.
Cont..
.(i)Effective and efficient management of data
(ii) Query processing and management
(iii)Easy to understand and user friendly
(iv) Security and integrity of data
(v) Better Decision making
(vi) Data sharing and storage
A simplified database system environment .
Design of a new application for an existing database or design
of a brand new database starts off with a phase called
requirements specification and analysis.

These requirements are documented in detail and transformed


into a conceptual design represented and manipulated using
some computerized tools so that it can be easily maintained,
modified, and transformed into a database implementation.

The design is then translated to a logical design that can be


expressed in a data model .

The final stage is physical design, provided for storing and


accessing the database.
Characteristics of the Database Approach
In traditional file processing, each user defines and implements
the files needed for a specific software application as part of
programming the application.
For example, one user, the grade reporting office, may keep
files on students and their grades. Programs to print a student’s
record and to enter new grades are implemented as part of the
application.
A second user, the accounting office, may keep track of
students’ fees and their payments. Although both users are
interested in data about students, each user maintains separate
files— and programs to manipulate these files—because each
requires some data not available from the other user’s files.
redundancy and storing data results in wasted storage
space.
The main characteristics of the database approach versus
the file-processing approach are the following:

• Self-describing nature of a database system


• Insulation between programs and data, and data
abstraction
• Support of multiple views of the data
• Sharing of data and multiuser transaction
processing
Self-Describing Nature of a Database
System
DB approach
Database system contains not only the database itself but also a
complete definition or description of the database structure and
constraints.
• Definition is stored in the DBMS catalog, which contains
information such as the structure of each file, the type and
storage format of each data item, and various constraints on
the data.
• Information stored in the catalog is called meta-data, and it
describes the structure of the primary database.
• Whenever a request is made to access, say, the Name of a
STUDENT record, the DBMS software refers to the catalog
to determine the structure of the STUDENT file and the
position and size of the Name data item within a STUDENT
record.
Traditional file processing
• In traditional file processing, data definition is typically
part of the application programs themselves.
• Programs are constrained to work with only one specific
database, whose structure is declared in the application
programs.
• In a file-processing application, the file structure the exact
location of Name within a STUDENT record are already
coded within each program that accesses this data item
Insulation between programs and data, and data
abstraction
In traditional file processing, the structure of data files is
embedded in the application programs, so any changes to the
structure of a file may require changing all programs that
access that file.
For example, a file access program may be written in such a
way that it can access only STUDENT records of the structure,
If we want to add another piece of data to each STUDENT
record, say the Birth_date, such a program will no longer work
and must be changed
DB approach
• DBMS access programs do not require such changes in
most cases.
• The structure of data files is stored in the DBMS catalog
separately from the access programs. We call this property
program-data independence.
• we only need to change the description of STUDENT
records in the catalog to reflect the addition of the new data
item Birth_date; no programs are changed.
• The next time a DBMS program refers to the catalog, the
new structure of STUDENT records will be accessed and
used.
• In an object-oriented and object-relational systems, An
operation (also called a function or method) is specified in
two parts.
• The interface (or signature) of an operation includes the
operation name and the data types of its arguments (or
parameters).
• The implementation (or method) of the operation is
specified separately and can be changed without affecting
the interface.
• User application programs can operate on the data by
invoking these operations through their names and
arguments, regardless of how the operations are
implemented. This may be termed program-operation
independence.
• The characteristic that allows program-data independence
and program-operation independence is called data
abstraction.
Support of Multiple Views of the Data
• A database typically has many types of users, each of
whom may require a different perspective or view of the
database.
• A view may be a subset of the database or it may contain
virtual data that is derived from the database files but is not
explicitly stored.
• For example, one user of the database may be interested
only in accessing and printing the record of each student.
• A second user, who is interested only in checking that
students have taken all the basics of each course for which
the student registers, may require the view.
Sharing of Data and Multiuser Transaction
Processing
• A multiuser DBMS, it allow multiple users to access the
database at the same time.
• multiuser DBMS software is to ensure that concurrent
transactions operate correctly and efficiently.
• A transaction is an executing program or process that
includes one or more database accesses, such as reading or
updating of database records.
• The DBMS must have transaction properties. The
isolation property ensures that each transaction appears to
execute in separate from other transactions, even though
hundreds of transactions may be executing concurrently.
The atomicity property ensures that either all the database
operations in a transaction are executed or none are.
Actors on the Scene
• For a small personal database,
Ex: list of addresses one person defines, constructs,
and manipulates the database, and there is no sharing.
• For a Large database,
many people are involved in the design, use, and
maintenance of a large database with hundreds or
thousands of users.
• people who involve the day-to-day work use of a
large database called as actors on the scene.
• People who work to maintain the database system
environment but who are not actively interested in
the database contents as part of their daily job
called as workers behind database.
1.Database Administrators
• In any organization ,chief administrator is needed to
oversee and manage these resources since people uses
many resources.
• In a database environment, the primary resource is the
database itself, and the secondary resource is the DBMS
and related software.
• These resources is the responsibility of the database
administrator (DBA).
• The DBA is responsible for authorizing access to the
database, coordinating and monitoring its use, and
acquiring software and hardware resources as needed,
responsible for problems such as security breaks and poor
system response time.
Database Designers
• Database designers are responsible for identifying
the data to be stored in the database and choose
right structures to represent and store data.
• Responsibility of database designers to
communicate with all forthcoming database users
in order to understand their requirements and to
create a design that meets their requirements.
• They also define views for different categories of
users.
End Users
• End users are the people whose jobs require access
to the database for querying, updating, and
generating reports.
several categories of end users:
• Casual end users: use database occasionally, needing
different information each time,use query language to
specify their requests,typically middle- or high-level
managers.
• Naive/Parametric end users: The main job function is
frequently query/update the database using standard
canned transactions that have been carefully programmed
and tested in advance.
• Examples: bank tellers check account balances, post
withdrawals/deposits.
• reservation clerks for airlines, hotels, etc., check
availability of seats/rooms and make reservations.
• shipping clerks who use buttons, bar code scanners,
etc.
• Sophisticated end users: engineers, scientists,
business analysts who implement their own
applications to meet their complex needs.
• Standalone users maintain personal databases by
using ready-made program packages that provide
easy-to-use,menu-based or graphics-based
interfaces.
• An example is the user of a financial software
package that stores a variety of personal financial
data.
System Analysts and Application
Programmers (Software Engineers)
System Analysts: determine needs of end users,
especially naive and parametric users, and develop
specifications for canned transactions that meet these
needs.
Application Programmers: Implement, test,
document, and maintain programs that satisfy the
specifications mentioned above.
Such Analysts & Programmers called as software
developers or Engineers.
Workers behind the Scene
DBMS system designers and implementers:
• Design and implement the DBMS modules and interfaces
as a software package.
• A DBMS is a very complex software system that consists
of many components, or modules, including modules for
implementing the catalog, query language processing,
interface processing, accessing and buffering data,
controlling concurrency, and handling data recovery and
security.
Tool developers design and implement tools—the software
packages that helps to database model and design, and
improved performance.
• Tools are optional packages that are often purchased
separately, include packages for database design,
performance monitoring, natural language or graphical
interfaces, prototyping, simulation, and test data
generation. Independent software vendors develop and
market these tools.
Operators and maintenance personnel (system administration
personnel)
• responsible for the actual running and maintenance of the
hardware and software environment for the database
system.
Advantages of Using the DBMS Approach
Controlling Redundancy
Restricting Unauthorized Access
When multiple users share a large database, most users will
not be authorized to access all information in the database.
For example, financial data such as salaries and bonuses is
confidential, and only authorized persons are allowed to
access such data.
some users may only be permitted to retrieve data, whereas
others are allowed to retrieve and update.
A DBMS should provide a security and authorization
subsystem, which the DBA uses to create accounts and to
specify account restrictions.
For example, only the DBA’s staff may be allowed to use
certain privileged software, such as the software for creating
new accounts.
Similarly, parametric users may be allowed to access the
database only through the predefined apps or canned
transactions developed for their use.
Providing Persistent Storage for Program Objects
Providing Storage Structures and Search Techniques for
Efficient Query Processing
Database systems must provide capabilities for efficiently
executing queries and updates.
Because the database is typically stored on disk, the DBMS
must provide specialized data structures and search techniques
to speed up disk search for the desired records.
Ex: Indexing is a tree structure
In DBMS uses buffering to get data from hard disks to
memory.
Providing Backup and Recovery
• A DBMS must provide facilities for recovering from
hardware or software failures.
• The backup and recovery subsystem of the DBMS is
responsible for recovery.
For example, if the computer system fails in the middle of a complex
update transaction, the recovery subsystem is responsible for making sure
that the database is restored to the state it was in before the transaction
started executing.
Providing Multiple User Interfaces
Representing Complex Relationships among Data
Enforcing Integrity Constraintscertain integrity constraints that
must hold for the data. A DBMS should provide capabilities
for defining and enforcing these constraints. The simplest type
of integrity constraint involves specifying a data type for each
data item.
Ex:the Class data item within each STUDENT record must be a one-digit
integer and that the value of Name must be a string of no more than 30
alphabetic characters.
Chapter-2
Database System Concepts and
Architecture
Data Models, Schemas, and Instances
Data abstraction generally refers to the suppression of
details of data organization and storage.
Data model collection of concepts that can be used to
describe the structure of a database.
structure of a database: data types, relationships, and
constraints that apply to the data,also include a set of basic
operations for specifying retrievals and updates on the
database.
Categories of Data Models
1. High-level or conceptual data models
provide concepts that are close to the way many users
understand data. Concepts such as entities, attributes, and
relationships.
• An entity represents a real-world object or concept, such as
an employee or a project .
• 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 workson
relationship between an employee and a project.
2. 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.
3. Representational (or implementation) data model -in
between high level and low level – hide details of data storage
on disk but can be implemented on a computer system
directly.
Schemas
• The description of a database is called the database
schema, which is specified during database design and is
not expected to change frequently.
Object in the schema—such as STUDENT
• A schema diagram displays only some aspects of a schema,
such as the names of record types and data items, and some
types of constraints.
• The actual data in a database may change quite frequently.
Changes every time we add a new student or enter a new
grade.
• The data in the database at a particular moment in time is
called a database state or SNAPSHOT.
• It is also called the current set of occurrences or instances
in the database.
• When we define a new database, the corresponding database
state is the empty state with no data.
• We get the initial state of the database, 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.
• The DBMS stores the descriptions of the schema constructs
and constraints—also called the meta-data—in the DBMS
catalog .
• The schema is sometimes called the INTENSION, and a
database state is called an EXTENSION of the schema.
Three schema architecture and data
independence
The Three-Schema Architecture
• The goal of the three-schema architecture 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 storage 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.
• 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.
• Three schemas are only descriptions of data; the
actual data is stored at the physical level only.
• In the three-schema architecture, each user group
refers to its own external schema.
• Hence, the DBMS must transform a request
specified on an external schema into a request
against the conceptual schema, and then into a
request on the internal schema for processing over
the stored database.
• If the request is a database retrieval, the data
extracted from the stored database must be
reformatted to match the user’s external view.
• The processes of transforming requests and results
between levels are called mappings.
Data Independence
Defined as the capacity to change the schema at one level of a
database system without having to change the schema at the
next higher level.
Two types of data independence:
1. Logical data independence is the capacity to change the
conceptual schema without having to change external
schemas or application programs.
2. We may change the conceptual schema to expand the
database (by adding a record type or data item), to change
constraints, or to reduce the database (by removing a
record type or data item).
3. For example, the external schema of Figure 1.5(a) should
not be affected by changing the GRADE_REPORT file (or
record type) shown in Figure 1.2 into the one shown in
Figure 1.6(a).
Physical data independence
• The capacity to change the internal schema
without having to change the conceptual schema.
Hence, the external schemas need not be changed
as well.
• Changes to the internal schema may be needed
because some physical files were reorganized.
example, creating additional access structures to
improve the performance of retrieval or update.
• If the same data as before remains in the database,
we should not have to change the conceptual
schema.
• For example, providing an access path to improve
retrieval speed of SECTION records (Figure 1.2)
by semester and year should not require a query such
as list all sections offered in fall 2008 to be changed,
although the query would be executed more
efficiently by the DBMS by utilizing the new access
path.
Database Languages and Interfaces
Data definition language (DDL), is used by the DBA
and by database designers to define both schemas.
Storage definition language (SDL), is used to specify
the internal schema.
View definition language (VDL), to specify user
views and their mappings to the conceptual schema.
Data manipulation language(DML) provides set of
operations like retrieval, insertion, deletion, and
modification of the data.
• DBMS packages provide an integrated feature of
above languages into a single language called
Structured Query Language.
There are two main types of DMLs
• A high-level or nonprocedural DML high-level
DML statements either to be entered interactively
from a display monitor or terminal or to be
embedded in a general-purpose programming
language.
• can specify and retrieve many records in a single
DML statement; therefore, they are called set-at-a-
time or set oriented DMLs
• declarative language(What is to be done rather
than how to do)
A low level or procedural DML
• must be embedded in a general-purpose programming
language .
• retrieves individual records or objects from the database
and processes each separately.
• to retrieve and process each record from a set of records.
Low-level DMLs are also called record-at-a-time DMLs.
DBMS Interfaces
• Menu-Based Interfaces for Web Clients or Browsing.
These interfaces present the user with lists of options
(called menus) that lead the user through the formulation
of a request.
• Forms-Based Interfaces 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 displays a schema to the user in
diagrammatic form. The user then can specify a query by
manipulating the diagram. GUIs utilize both menus and
forms. Most GUIs use a pointing device.
• Natural Language Interfaces accepts requests written in
English or some other language and attempt to understand
them.
• Speech Input and Output use of speech as an input query
and speech as an answer to a question or result.
• Interfaces for Parametric Users such as bank tellers, often
have a small set of operations that they must perform
repeatedly.
• Interfaces for the DBA. DBA use privileged commands.
These include commands for creating accounts, setting
system parameters, granting account authorization,
changing a schema, and reorganizing the storage structures
of a database
The Database System Environment(Component
modules and interactions)
DBMS Component Modules
• The top part of the figure refers to the various users of the
database environment and their interfaces.
• The lower part shows the internals of the DBMS
responsible for storage of data and processing of
transactions.
• The database and the DBMS catalog are usually stored on
disk.
• Stored data manager controls access to DBMS
information that is stored on disk, whether it is part of the
database or the catalog.
Top half figure:
• It shows interfaces for the DBA staff, casual users who work
with interactive interfaces to formulate queries.
• Application programmers who create programs using some
host programming languages .
• parametric users who do data entry work by supplying
parameters to predefined transactions.
• The DBA staff works on defining the database and tuning it
by making changes to its definition using the DDL and other
privileged commands.
DBA staff:
• The DDL compiler processes schema definitions, specified
in the DDL, and stores descriptions of the schemas (meta-
data) in the DBMS catalog.
• The catalog includes information such as the names and sizes
of files, names and data types of data items, storage details of
each file, mapping information among schemas, and
constraints.
Casual users:
• interact using some form of interface, which we call the
interactive query interface
• queries are parsed and validated for correctness of the query
syntax, the names of files and data elements, and so on by a
query compiler that compiles them into an internal form
• This internal query is subjected to query optimization
• query optimizer is concerned with the rearrangement and
possible reordering of operations, elimination of
redundancies, and use of correct algorithms and indexes
during execution.
Application programmers
• write programs in host languages such as Java, C, or C++
that are submitted to a precompiler
• precompiler extracts DML commands from an application
program commands are sent to the DML compiler for
compilation rest of the program is sent to the host language
compiler.
• An example is a bank withdrawal transaction where the
account number and the amount may be supplied as
parameters
In the lower part of Figure,
• the runtime database processor executes (1) the privileged
commands (2) the executable query plans, and (3) the
canned transactions with runtime parameters.
• It works with the system catalog and may update it with
statistics
• It also works with the stored data manager, which in turn
uses basic operating system services for carrying out low-
level input/output (read/write) operations between the disk
and main memory
• The runtime database processor handles other aspects of
data transfer, such as management of buffers concurrency
control and backup and recovery systems, integrated into
the working of the runtime database processor for purposes
of transaction management.
Database System Utilities
To perform certain functions such as:
• Loading data stored in files into a database.
Includes data conversion tools.
• Backing up the database periodically on
tape.
• Reorganizing database file structures.
• Report generation utilities.
• Performance monitoring utilities.
• Other functions, such as sorting, user
monitoring, data compression, etc.
Tools, Application Environments, and Communications
Facilities CASE tools are used in the design phase of database
systems .
• Data dictionary (or data repository) system for storing
catalog information about schemas and constraints
• Information repository stores information such as design
decisions, usage standards, application program
descriptions, and user information .
• Application development environment systems provide an
environment for developing database applications, including
database design, GUI development, querying and updating,
and application program development.
Centralized and Client/Server Architectures for
DBMS’s
Centralized DBMS:
• Combines everything into single system including- DBMS
software, hardware, application programs, and user interface
processing software.
• User can still connect through a remote terminal – however,
all processing is done at centralized site
A Physical Centralized
Architecture
Basic Client/Server Architectures
• The client/server architecture was developed to
deal with large number of PCs, workstations, file
servers, printers, database servers, Web servers, e-
mail servers, and other software and equipment
are connected via a network.
• Specialized Servers with Specialized
functions
File server(possible to connect a number of PCs or small
workstations as clients to a file server that maintains the
files of the client machines).
Print server (all print requests by the clients are
forwarded to this machine)
DBMS Server
• Provides database query and transaction services
to the clients.
• Relational DBMS servers are often called SQL
servers, query servers, or transaction servers.
• Applications running on clients utilize an
Application Program Interface (API) to access
server databases via standard interface such as:
ODBC: Open Database Connectivity standard
JDBC: for Java programming access
DBMS server
Web server
Email server
• Clients can access the specialized servers as
needed.
Logical two-tier client server
architecture
Clients
• Provide appropriate interfaces through a
client software module to access and utilize
the various server resources.
• Clients may be diskless machines or PCs or
Workstations with disks only the client
software installed.
• Connected to the servers via some form of a
network.
(LAN: local area network, wireless network, etc.)
Two Tier Client-Server Architecture
• The user interface programs and application
programs can run on the client side.
• When DBMS access is required, the program
establishes a connection to the DBMS (which is on
the server side).
• Once the connection is created, the client program
can communicate with the DBMS.
• A standard called Open Database Connectivity
(ODBC) provides an application programming
interface (API), which allows client-side programs
to call the DBMS, as long as both client and server
machines have the necessary software installed.
• Most DBMS vendors provide ODBC drivers
for their systems.
• A client program can connect to several
RDBMSs and send query and transaction
requests using the ODBC API, which are
then processed at the server sites.
• Any query results are sent back to the client
program, which can process and display the
results as needed.
• A related standard for the Java programming
language, called JDBC, has also been
defined.
• This allows Java client programs to access
one or more DBMSs through a standard
interface.
• The architectures described here are called
two-tier architectures because the software
components are distributed over two
systems: client and server.
• The advantages of this architecture are its
simplicity and compatibility.
Three Tier Client-Server
Architecture
• Many Web applications use an architecture called
the three-tier architecture, which adds an
intermediate layer between the client and the
database server.
• This intermediate layer or middle tier is called the
application server or the Web server, depending on
the application.
• It can also improve database security by checking a
client’s credentials before forwarding a request to
the database server.
• Clients contain user interfaces and Web browsers. r
• Three-tier Architecture Can Enhance Security:
• Database server only accessible via middle tier
• The intermediate server accepts requests
from the client, processes the request and
sends database queries and commands to the
database server.
• The user interface, application rules, and
data access act as the three tiers. Figure
2.7(b) shows another view of the three-tier
architecture used by database and other
application package vendors.
• The presentation layer displays information
to the user and allows data entry.
• The business logic layer handles
intermediate rules and constraints before
data is passed up to the user or down to the
DBMS.
• The bottom layer includes all data
management services.
• The middle layer can also act as a Web
server, which retrieves query results from
the database server and formats them into
dynamic Web pages that are viewed by the
Web browser at the client side.
• The client machine is typically a PC or
mobile device connected to the Web.
Three-tier client-server
architecture
Chapter 3

Data Modeling Using the Entity-


Relationship (ER) Model
A Sample Database Application

You might also like