Upload
ezra-lang
View
216
Download
0
Tags:
Embed Size (px)
Citation preview
2. Database System Concepts and Architecture
Chapter 2
Course Coordinator:
Dr. Deema Alathel
Lecturer:
Ms. Arwa Alturki
2.1 Data Models, Schemas, and Instances
Data Model: A collection of concepts used to describe the structure of a database
Database Structure: Data types, relationships, and constraints on data
Database Schema: The description of the database (intension)
Schema Diagram: Diagrammatic representation of the DB schema
Schema Construct: An object in the schema
Database State/Instance: The data in the database at a particular moment in time (extension)
2.1 Data Models, Schemas, and Instances
Schema diagram displays some aspects of the schema Data types and relationships are not evident
Define a new DB? Specify the DB schema DB state is the empty state
Populate DB with initial data? No changes in the schema DB state is the initial state
Subsequent update operations? No changes in the schema DB state changes into a new state
2.1 Data Models, Schemas, and Instances
DBMS ensures that every DB state is a valid state A state that satisfies the structure and constraints
specified in the schema
Special care must be taken when designing a DB schema A schema is not supposed to change frequently
A DBMS stores the meta-data Schema constructs and constraints
2.2 DBMS Architecture and Data Independence
DB architecture is specified using a three-schema architecture
Used to achieve the first 3 characteristics of DB approach
1. Separation between programs and data
2. Support of multiple user views
3. Use of catalog to store DB schema
Provides only a description of data
2.2.1 The Three-Schema Architecture
1. Physical (Internal) Level Has an internal schema Describes the physical storage structure of the DB
2. Logical (Conceptual) Level Has a conceptual schema Describes the structure of the whole DB (entities, data types,
relationships, user operations, and constraints) Hides details of the physical level
3. External (View) Level Has several external schemas or user views Each describes the part of the DB that a particular user is
interested in
2.2.1 The Three-Schema Architecture
Internal Schema
Conceptual Schema
ExternalView
ExternalView
…
mapping
mapping
mapping
2.2.2 Data Independence Data Independence
Ability to change the schema at one level of a DB system without having to change the schema at the next higher level
Result?1. Logical data independence
2. Physical data independence
2.2.2 Data Independence
1. Logical data independence Ability to change the conceptual schema without
having to change the external schemas or application programs
Changes? Expand the DB (add a record or data item) Reduce the DB (remove a record or data item) Changes to constraints
2.2.2 Data Independence
2. Physical data independence Ability to change the internal schema without
having to change the conceptual or external schemas
Changes? Reorganization of physical files
2.3.1 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)andview definition language (VDL) are used to define internal and external schemas SDL is typically realized via DBMS commands provided to the DBA
and database designers
2.3.1 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).
2.3.1 DBMS Languages
Data Manipulation Language (DML) DML Types:
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. Also called declarative languages.
Low Level or Procedural Language Retrieve data one record-at-a-time; Constructs such as looping are needed to retrieve multiple records,
along with positioning pointers
2.3.2 DBMS Interfaces Menu-Based Interfaces
Popular for browsing the Web Forms-Based Interfaces
Designed for naïve users Graphical User Interfaces (GUI)
Point and Click, Drag and Drop, etc. Natural Language Interfaces
Requests are written in English Speech Input and Output
Speech used as input query and/or as query result Interfaces for Parametric Users
Ex: bank tellers using function keys Interfaces for the DBA
Commands used for Creating user accounts, granting authorizations, setting system parameters, changing schemas or access paths
2.5 DBMS Architectures1. Centralized DBMSs Architecture
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
2.5 DBMS Architectures2. Basic Client/Server Architectures
Specialized Servers with Specialized functions (Print server, File server, DBMS server, Web server, Email server)
Clients can access the specialized servers as needed
2.5 DBMS Architectures3. Two-Tier Client/Server Architectures
A client program may connect to several DBMSs, sometimes called the data sources
Data sources can be files or other non-DBMS software that manages data Other variations of clients are possible
2.5 DBMS Architectures4. Three-Tier and n-tier Architectures
Common for Web applications Intermediate Layer called Application Server or Web Server: Such an architecture can enhance security:
Database server only accessible via middle tier Clients cannot directly access database server
2.6 Classification of Database Management Systems
Several criteria are used Data Model
Traditional1. Relational data model
2. Network data model
3. Hierarchical data model Emerging
4. Object data model
5. Object-relational data model
Number of Users1. Single-user systems
2. Multi-user systems
2.6 Classification of Database Management Systems
Number of Sites1. Centralized DBMS
2. Distributed DBMS Homogeneous DDBMS Heterogeneous DDBMS Federated DBMS (multidatabase system)