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

W2 DBMS Chapter02

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

W2 DBMS Chapter02

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

CHAPTER 2

Database
System
Concepts
and
Architecture

Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 1- 1


Outline
 Data Models and Their Categories
 History of Data Models
 Schemas, Instances, and States
 Three-Schema Architecture
 Data Independence
 DBMS Languages and Interfaces
 Database System Utilities and Tools
 Centralized and Client-Server Architectures
 Classification of DBMSs

Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 2


Data Models (1)
 Data Model:
 A set of concepts to describe the structure of a database,
the operations for manipulating these structures, and
certain constraints that the database should obey.
 Data Model Structure and Constraints:
 Constructs are used to define the database structure
 Constructs typically include elements (and their data
types) as well as groups of elements (e.g. entity, record,
table), and relationships among such groups
 Constraints specify some restrictions on valid data; these
constraints must be enforced at all times

Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 3


Data Models (2)
 Data Model Operations:
 These operations are used for specifying database
retrievals and updates by referring to the
constructs of the data model.
 Operations on the data model may include basic
model operations (e.g. generic insert, delete,
update) and user-defined operations (e.g.
compute_student_gpa, update_inventory)

Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 4


Categories of Data Models (1)
 Conceptual (high-level, semantic) data models:
 Provide concepts that are close to the way many users

perceive data. Its use concepts such as entities,


attributes, and relationships.
 Implementation (representational) data models:
 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.
 The models used most frequently in traditional

commercial DBMSs. These include relational, network ,


hierarchical, and object data model data models

Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 5


Categories of Data Models (2)
 Physical (low-level, internal) data models:
 Provide concepts that describe the details of how data is

stored on the computer storage media as files in the


computer by representing information such as record
formats, record orderings, and access paths.
 This concepts are generally meant for computer

specialists, not for end users.


 Self-Describing Data Models:
 The data combines the description of the data with the

data values themselves. These models include XML as


well as many of the key-value stores and NOSQL
systems that were recently created for managing big
data.
Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 6
Schemas, Instances, and Database
State(1)
 Database Schema:
 The description of a database.
 Includes descriptions of the database structure, data
types, and the constraints on the database.
 Schema Diagram:
 An illustrative display of (most aspects of) a
database schema. The diagram displays only some
aspects of a schema, such as the names of record
types and data items, and some types of constraints.
 Schema Construct:
 A component of the schema or an object within the
schema, e.g., STUDENT, COURSE.
Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 7
Schemas, Instances, and Database
State(2)
 Database State:
 The actual data stored in a database at a particular moment in time.

This includes the collection of all the data in the database. Also called
database instance (or occurrence or snapshot). (The term instance
is also applied to individual database components, e.g. record
instance, table instance, entity instance)
 Refers to the content of a database at a moment in time.

 Initial Database State:


 Refers to the database state when it is initially loaded into the system.

 Valid State:
 A state that satisfies the structure and constraints of the database.

 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.

Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 8


Example of a Database Schema

Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 9


Example of a database state

Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 10


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. Its implemented using a representational data model.

Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 11


The three-schema architecture

Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 12


Database Languages and Interfaces
 DBMS supported variety of users and provide
appropriate languages and interfaces for each
category of users.
 Database Language is a special type of
programming language used to define and
manipulate a database. Based on their application,
database languages are classified into four different
types: DDL, DML, DCL, and TCL.
 DBMS interface is a user interface that allows for
the ability to input queries to a database without
using the query language itself.
Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 13
Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 14
DBMS Languages(1)
 Data Definition Language (DDL):
 Is a set of special commands that allows us to define
and modify the structure and the metadata of the
database. These commands can be used to create,
modify, and delete the database structures such as
schema, tables, indexes, etc.
 Is used by the DBA and by database designers to
define both schemas. The DBMS will have a DDL
compiler whose function is to process DDL statements
in order to identify descriptions of the schema
constructs and to store the schema description in the
DBMS catalog.
Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 15
DBMS Languages(2)
 Data Definition Language (DDL): some tasks that come
under DDL:
 Create: It is used to create objects in the database.

 Alter: It is used to alter the structure of the

database.
 Drop: It is used to delete objects from the database.

 Truncate: It is used to remove all records from a

table.
 Rename: It is used to rename an object.

 Comment: It is used to comment on the data

dictionary.
Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 16
DBMS Languages(3)
 Data Manipulation Language (DML):
 Is a set of special commands that allows us to
access and manipulate data stored in existing
schema objects. These commands are used to
perform certain operations.
 Once the database schemas are compiled and the
database is populated with data, users must have
some means to manipulate the database. Typical
manipulations include retrieval, insertion, deletion,
and modification of the data.

Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 17


DBMS Languages(4)
 Data Manipulation Language (DML): some tasks that come
under DML
 Select: It is used to retrieve data from a database.

 Insert: It is used to insert data into a table.

 Update: It is used to update existing data within a table.

 Delete: It is used to delete all records from a table.

 Merge: It performs UPSERT operation, i.e., insert or update

operations.
 Call: It is used to call a structured query language or a Java

subprogram.
 Explain Plan: It has the parameter of explaining data.

 Lock Table: It controls concurrency.

Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 18


DBMS Languages(5)
 Data Control Language (DCL):
 is a set of special commands that are used to
control the user privileges in the database system.
The user privileges include ALL, CREATE,
SELECT, INSERT, UPDATE, DELETE, EXECUTE,
etc.
 User access is controlled using the DCL
statements. These statements are:

Grant : It is used to provide user access to the
database or its object.

Revoke : It is used to revoke user access to the
database system.
Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 19
DBMS Languages(6)
 Transaction Control Language (TCL):
 Is a set of special commands that deal with the
transactions within the database.
 A transaction is a collection of related tasks that are
treated as a single execution unit by the DBMS
software.
 TCL commands are used to keep a check on other
commands and their effects on the database. These
include:

Commit: It is used to save the transaction on the
database.

Rollback: It is used to restore the database to original
since the last Commit.
Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 20
User-friendly interfaces provided by a
DBMS (1)
 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.
 Apps for Mobile Devices. These interfaces present
mobile users with access to their data. For example,
banking, reservations, and insurance companies, among
many others, provide apps that allow users to access their
data through a mobile phone or mobile device.

Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 21


User-friendly interfaces provided by a
DBMS (2)
 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
 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.
Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 22
User-friendly interfaces provided by a
DBMS (3)
 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.
 Keyword-based Database Search: These are somewhat
similar to Web search engines, which accept strings of
natural language words and match them with documents
at specific sites or Web pages on the Web. They use
predefined indexes on words and use ranking functions to
retrieve and present resulting documents in a decreasing
degree of match.
Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 23
User-friendly interfaces provided by a
DBMS (4)
 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. 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. Usually a small set of abbreviated
commands is included, with the goal of minimizing the
number of keystrokes required for each request.

Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 24


DBMS Component Modules
 A DBMS is a complex software system constitute
from types of software components and interacts
with other types of computer system software.
 Figure below illustrates, in a simplified form, the
typical DBMS components. The figure is divided
into two parts.
 The top part of the figure refers to the various users
of the database environment and their interfaces.
 The lower part shows the internal modules of the
DBMS responsible for storage of data and
processing of transactions.
Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 25
Typical DBMS Component Modules

Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 26


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.
 Performance monitoring utilities.
 Report generation utilities.
 Other functions, such as sorting, user monitoring,
data compression, etc.

Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 27


Tools, Application Environments,
and Communications Facilities
 CASE tools are used in the design phase of database systems.
 Tool that can be quite useful in large organizations is an
expanded data dictionary system.
 Application development environments, such as PowerBuilder
(Sybase) or JBuilder (Borland), have been quite popular. These
systems provide an environment for developing database
applications
 Many commercial database systems have communication
packages that work with the DBMS. The integrated DBMS and
data communications system is called a DB/DC system.
 Some distributed DBMSs are physically distributed over multiple
machines. In this case, communications networks are needed to
connect the machines.

Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 28


Centralized and Client/Server
Architectures for DBMSs
 Architectures for DBMSs have followed trends similar to
those for general computer system architectures.
 Older architectures used mainframe computers to provide
the main processing for all system functions, including user
application programs and user interface programs, as well as
all the DBMS functionality.
 In Centralized DBMS all the DBMS functionality, application
program execution, and user interface processing were
carried out on one machine.
 As prices of hardware declined, most users replaced their
terminals with PCs and workstations, and more recently with
mobile devices.

Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 29


Basic Client/Server Architectures
 The concept of client/server architecture assumes an
underlying framework that consists of many
PCs/workstations and mobile devices as well as a smaller
number of server machines, connected via wireless networks
or LANs and other types of computer networks.
 A client in this framework is typically a user machine that
provides user interface capabilities and local processing.
 A server is a system containing both hardware and software
that can provide services to the client machines, such as file
access, printing, archiving, or database access.
 In general, some machines install only client software, others
only server software, and still others may include both client
and server software
Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 30
Client/Server Architectures for
DBMSs
 The client/server architecture was developed to deal with computing
environments in which a 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.
 The idea is to define specialized servers with specific functionalities,
and client machines provide the user with the appropriate interfaces
to utilize these servers, as well as with local processing power to run
local applications.
 Example to specialized servers are:
 file server that maintains the files of the client machines.

 printer server by being connected to various printers; all print

requests by the clients are forwarded to this machine.



Web servers, DBMS server, or e-mail servers also fall into the
specialized server category.

Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 31


Two-Tier Client/Server
Architectures for DBMSs
 In two-tier architectures software components
are distributed over two systems: client and
server.
 The user interface programs and application
programs can run on the client side.
 The query and transaction functionality related to
SQL processing on the server side
 The advantages of this architecture are its
simplicity and seamless compatibility

Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 32


Logical two-tier client server architecture

Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 33


Three-Tier and n-Tier Architectures
for Web Applications
 The emergence of the Web changed the roles of clients and servers,
leading to the three-tier 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. This server plays an
intermediary role by running application programs and storing business
rules (procedures or constraints) that are used to access data from the
database server.
 Clients contain user interfaces and Web browsers. The intermediate server
accepts requests from the client, processes the request and sends
database queries and commands to the database server.
 Other architectures have also been proposed. It is possible to divide the
layers between the user and the stored data further into finer components,
thereby giving rise to n-tier architectures, where n may be four or five tiers.
Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 34
Three-tier client-server architecture

Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 35


Classification of DBMSs
Several criteria can be used to classify DBMSs, such as:
 Based on the data model used
 Legacy: Network, Hierarchical, Currently Used: Relational,

Object-oriented, Object-relational. Recent Technologies: Key-


value storage systems, NOSQL systems.
 Based on the number of users supported:
 Single-user (typically used with personal computers)
vs. multi-user (most DBMSs).
 Based on the number of sites database is distributed
 Centralized (uses a single computer with one database) vs.

distributed (multiple computers, multiple DBs)


 Based on Cost:
 Range: from free open-source systems to configurations
costing millions of dollars
 DBMS can be general purpose or special purpose.

Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 36


Assignment 2
 Write 3-4 pages report to explain
NOSQL system that recently
created for managing big data.

Copyright © 2017 Ramez Elmasri and Shamkant B. Navathe Slide 2- 37

You might also like