Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

L2

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 28

RCS 201

L-2

06/12/2020 RCS 201 1


Database System Concepts and
Architecture
Outline
• Data Models and Their Categories
• History of Data Models
• Schemas, Instances, and States
• Three-Schema Architecture
• Data Independence
• DBMS Languages
• Database System Utilities
• Centralized and Client-Server Architectures
• Classification of DBMSs
06/12/2020 RCS 201 2
Data Models
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.
• By structure of a database we mean the data types, relationships, and constraints
that apply to the data
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
06/12/2020 RCS 201 3
Data Models(continued)
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)

06/12/2020 RCS 201 4


Categories of Data Models
Conceptual (high-level, semantic) data models:
• Provide concepts that are close to the way many users perceive data.
• (Also called entity-relationship model or object-based data models.)
Physical (low-level, internal) data models:
• Provide concepts that describe how data is stored as files in the computer by representing information such as record
formats, record orderings, and access paths
• These are usually specified in an ad-hoc manner through DBMS design and administration manuals
Implementation (representational) data models:
• record-based data models
• Provide concepts that fall between the above two, used by many commercial DBMS implementations (e.g. relational data
models used in many commercial systems also network and hierarchical models—that have been widely used in the past ).
self-describing data models.
• combines the description of the data with the data values themselves
• These models include XML and NOSQL systems that were recently created for managing big data.

06/12/2020 RCS 201 5


Group Assignment: History of Data Models
The Evolution of Database Modeling/ History of Data Models : when was is it
discovered ,who was the pioneer(s), when was is started, Example of DBMS used.
what are the advantages and disadvantage/limitations of it.
• File Systems
• Hierarchical Database Model
• Network Database Model
• Relational Database Model
• Object oriented Database Model
• Object-Relational Database Model
• big data systems, also known as key-value storage systems and NOSQL
systems.
06/12/2020 RCS 201 6
Schemas, Instances, and Database State
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.
Schema Construct:
• A component of the schema or an object within the schema, e.g., STUDENT, COURSE.
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.

06/12/2020 RCS 201 7


Database Schema vs. Database State
Database State:
• 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.
 Distinction
• 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 of schema.
06/12/2020 RCS 201 8
Example of a Database Schema

06/12/2020 RCS 201 9


Example of a database state

06/12/2020 RCS 201 10


Three-Schema Architecture
 Proposed to support DBMS characteristics of:
• Program-data independence.

Support of multiple views of the data.
• The goal of the three-schema architecture, is to separate the user applications from the physical database.

 Not explicitly used in commercial DBMS products, but has been useful in explaining
database system organization.
 Defines DBMS schemas at three levels:

 Internal schema at the internal level to describe physical storage structures and

access paths (e.g indexes) of the database.



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 implementation data model or representational data model
 External schemas at the external level to describe the various user views.

Usually uses the same data model as the conceptual schema.

06/12/2020 RCS 201 11


The three-schema architecture

06/12/2020 RCS 201 12


Three-Schema Architecture

• Mappings among schema levels are needed to


transform requests and data.

• Programs refer to an external schema, and are mapped by the DBMS


to the internal schema for execution.

• Data extracted from the internal DBMS level is reformatted to match


the user’s external view (e.g. formatting the results of an SQL query for
display in a Web page)

06/12/2020 RCS 201 13


Data Independence
• Data independence- the capacity to change the schema at one level of a database system
without having to change the schema at the next higher level.

• Logical Data Independence:


• The capacity to change the conceptual schema without having to change the external schemas
and their associated application programs.
• Physical Data Independence:
• The capacity to change the internal schema without having to change the conceptual schema.
• For example, the internal schema may be changed when certain file structures are reorganized
or new indexes are created to improve database performance.
• When a schema at a lower level is changed, only the mappings between this
schema and higher level schemas need to be changed in a DBMS that fully supports
data independence.
• The higher-level schemas themselves are unchanged.
Hence, the application programs need not be changed since they refer to the external schemas.

06/12/2020 RCS 201 14


DBMS Languages
 Data Definition Language (DDL)
 Data Manipulation Language (DML)

 High-Level or Non-procedural Languages: These

include the relational language SQL


• May be used in a standalone way or may be embedded in a
programming language
 Low Level or Procedural Languages:
• These must be embedded in a programming language

06/12/2020 RCS 201 15


DBMS Languages
 Data Definition Language (DDL):
• Used by the DBA and database designers to specify the
conceptual schema of a database.
• In many DBMSs, the DDL is also used to define internal and
external schemas (views).
• In some DBMSs, separate storage definition language (SDL)
and view definition language (VDL) are used to define internal
and external schemas. Example SQL in RDBMS is a VDL
• SDL is typically realized via DBMS commands provided to the
DBA and database designers.

06/12/2020 RCS 201 16


DBMS Languages
 Data Manipulation Language (DML):
• Used to specify database retrievals and updates . DML
commands (data sublanguage) can be embedded in a general-
purpose programming language (host language), such as
COBOL, C, C++, or Java.
• A library of functions can also be provided to access the DBMS
from a programming language
• Alternatively, stand-alone DML commands can be applied
directly (called a query language).

06/12/2020 RCS 201 17


Types of DML
 High Level or Non-procedural Language:
• For example, the SQL relational language
• Are “set”-oriented and specify what data to retrieve rather than how to retrieve it.

• Non procedural DMLs require a user to specify what data are needed without
specifying how to get those data.
• Also called declarative languages.
 Low Level or Procedural Language:
• Retrieve data one record-at-a-time;
• Procedural DMLs require a user to specify what Data are needed and how to get
those data. e.g., PL/SOL
• Constructs such as looping are needed to retrieve multiple records, along with

positioning pointers.

06/12/2020 RCS 201 18


Database System Utilities

• In addition to possessing the software modules just described, most DBMSs have database
utilities that help the DBA manage the database system.
■ Loading. A loading utility is used to load existing data files such as text files or sequential files
into the database.
• Thus transferring data from one DBMS to another is becoming common in many organizations.
■ Backup. A backup utility creates a backup copy of the database, usually by dumping the entire
database onto tape or other mass storage medium.
■ Database storage reorganization. This utility can be used to reorganize a set of database files
into different file organizations and create new access paths to improve performance.
■ Performance monitoring. Such a utility monitors database usage and provides statistics to the
DBA.
• The DBA uses the statistics in making decisions such as whether or not to reorganize files or
whether to add or drop indexes to improve performance.

06/12/2020 RCS 201 19


Centralized and
Client-Server DBMS Architectures
 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.
Basic Client/Server Architectures
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.
A client in this framework is typically a user machine that provides user interface
capabilities and local processing.
Client/Server Architectures 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.
Basic Client/Server Architectures…
Logical two-tier client/server
architecture. Physical two-tier client/server architecture.
Two-Tier Client/Server Architectures for DBMSs-
• Two-tier architectures because the software components are distributed over two systems:
client and server

• 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 with only the
client software installed.

• Connected to the servers via some form of a network.


(LAN: local area network, wireless network, etc.)
• The user interface and application programs are located on the client.
• The query and transaction functionality related to SQL processing remained on the server
side.
DBMS Server
• Provides database query and transaction services to the clients
• Relational DBMS servers are often called SQL servers, query
servers, or transaction servers. example MS SQL server
• 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
• Client and server must install appropriate client module and server
module software for ODBC or JDBC
• The emergence of the Web changed the roles of clients and
servers, leading to the three-tier architecture.
Three Tier Client-Server Architecture
• Common for Web applications
• Intermediate Layer called Application Server or Web Server:

• Stores the web connectivity software and the business logic


part of the application used to access the corresponding data
from the database server
• Acts like a conduit for sending partially processed data between
the database server and the client.
• Three-tier Architecture Can Enhance Security:
• Database server only accessible via middle tier
• Clients cannot directly access database server
Logical three-tier client/server architecture, with a couple of
commonly used nomenclatures.
Classification of DBMSs
Based on the data model used
• Traditional: Relational, Network, Hierarchical.
• Emerging: Object-oriented, Object-relational.
• Recently, so-called big data systems, also known as key-value storage systems and NOSQL systems.
The number of users supported by the system-
• Single-user systems support only one user at a time and are mostly used with PCs. Example MS Access.
• Multiuser systems, which include the majority of DBMSs, support concurrent multiple users.
Number of sites over which the database is distributed.
• A DBMS is centralized if the data is stored at a single computer site. A centralized DBMS can support multiple users, but the DBMS and the
database reside totally at a single computer site.
• A distributed DBMS (DDBMS) can have the actual database and DBMS software distributed over many sites connected by a computer network.
Big data systems are often massively distributed, with hundreds of sites.
The data is often replicated on multiple sites so that failure of a site will not make some data unavailable.
Cost.
• open source (free) DBMS products like MySQL and PostgreSQL that are supported by third-party vendors with
additional services.
• Commercial DBMS like DB2 (from IBM), Oracle (from Oracle), Sybase DBMS (now from SAP), and SQLServer and
Microsoft Access (from Microsoft)
 Types of access path options for storing files
• inverted file structures
• Don’t cry because it’s over. Smile because it happened.

06/12/2020 RCS 201 28

You might also like