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

Data Base System Ch2

The document discusses database system concepts and architecture. It covers topics such as data models, database schemas, database instances, the three-schema architecture, centralized and client-server architectures, and classifications of database management systems. The key aspects are the conceptual, logical, and physical representations of data in a database system and how they relate through mappings in the three-schema architecture.

Uploaded by

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

Data Base System Ch2

The document discusses database system concepts and architecture. It covers topics such as data models, database schemas, database instances, the three-schema architecture, centralized and client-server architectures, and classifications of database management systems. The key aspects are the conceptual, logical, and physical representations of data in a database system and how they relate through mappings in the three-schema architecture.

Uploaded by

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

Chapter – Two

Database System Concepts


and
Architecture
Data Model

Data Model: A set of concepts to describe the structure of a


database, and certain constraints that the database should obey.

Data Model Operations: Operations for specifying database


retrievals and updates by referring to the concepts of the data
model. Operations on the data model may include basic
operations and user-defined operations.
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)

2
Categories of data models

1. Conceptual (high-level, semantic) data models: Provide


concepts that are close to the way many users perceive data.
(Also called entity-based or object-based data models.)

3
Categories of data models
2. Physical (low-level, internal) data models: Provide
concepts that describe details of how data is stored in the
computer. These are usually specified in an ad-hoc manner
through DBMS design and administration manuals
Categories of data models
3. Implementation (representational) data models: Provide
concepts that fall between the above two, balancing user
views with some computer storage details.
Schema vs Instance(State)
Database Schema: The description of a database. Includes
descriptions of the database structure and the constraints that
should hold on the database.

Schema Diagram: A diagrammatic display of (some aspects of) a


database schema.

Schema Construct: A component of the schema or an object


within the schema, e.g., STUDENT, COURSE.

Database Instance: The actual data stored in a database at a


particular moment in time. Also called database state (or
occurrence).

6
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
when it is loaded
– 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.
Three-Schema Architecture
Proposed to support DBMS characteristics of:
1. Program-data independence.
2. Support of multiple views of the data.

Defines DBMS schemas at three levels:


1. Internal schema at the internal level to describe physical
storage structures and access paths. Typically uses a physical
data model.
2. Conceptual schema at the conceptual level to describe the
structure and constraints for the whole database for a
community of users. Uses a conceptual or an implementation
data model.
3. External schemas at the external level to describe the various
user views. Usually uses the same data model as the
conceptual level.
8
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.
9
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
– Specialized Servers with Specialized functions
– Clients
– DBMS Server
Specialized Servers with
Specialized functions:
• File Servers
• Printer Servers
• Web Servers
• E-mail Servers
Clients:
• Provide appropriate interfaces and a client
version of the system to access and utilize the
server resources.
• Clients maybe diskless machines or PCs or
Workstations with disks with only the client
software installed.
• Connected to the servers via some form of a
network.
DBMS Server
• Provides database query and transaction
services to the clients
• Sometimes called query and transaction
servers
Two Tier Client-Server Architecture
• User Interface Programs and Application
Programs run on the client side
• Interface called ODBC (Open Database
Connectivity) provides an Application
program interface (API) allow client side
programs to call the DBMS. Most DBMS
vendors provide ODBC drivers.
Two Tier Client-Server Architecture
• A client program may connect to several
DBMSs.
• Other variations of clients are possible: e.g., in
some DBMSs, more functionality is transferred
to clients including data dictionary functions,
optimization and recovery across multiple
servers, etc. In such situations the server may
be called the Data Server.
Logical two-tier client server
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 rules and
business logic (constraints) part of the application used to
access the right amount of data from the database server
– acts like a conduit for sending partially processed data
between the database server and the client.
• Additional Features- Security:
– encrypt the data at the server before transmission
– decrypt data at the client
Three-tier client-server architecture
Data Independence

Data independence is a capacity of DBMS to change the


schema at one level of a database system without having to
change the schema at the next higher level.

1. Logical Data Independence: The capacity to change the


conceptual schema without having to change the external
schemas and their application programs.
2. 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
19
DBMS Languages
1. DDL(Data Definition Language ), is 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).
2. SDL (storage definition language), is used to specify the
internal schema.
3. VDL (view definition language), Specifies user
views/mappings to conceptual schema
4. DML (Data manipulation language), is used to manipulate the
database. Typical manipulations include retrieval, insertion,
deletion and modification of the data. This can be embedded in
a general-purpose programming language (host language),
such as COBOL, C or an Assembly Language and
alternatively, stand-alone DML commands can be applied
directly (query language).
20
DBMS Languages

There are two main types of DMLs:

1. High Level or Non-procedural Languages: May be used in a


standalone way or may be embedded in a programming
language e.g., SQL, are set-oriented and specify what data to
retrieve than how to retrieve. Also called declarative
languages.
2. Low Level or Procedural Languages: These must be
embedded in a programming. Language record-at-a-time; they
specify how to retrieve data and include constructs such as
looping.

21
DBMS Interfaces
• Stand-alone query language interfaces.
– Example: Entering SQL queries at the DBMS
interactive SQL interface
• Programmer interfaces for embedding DML in
programming languages:
– Like Pre-compiler and Procedure (Subroutine) Call
Approach
• User-friendly interfaces:
– Menu-based, forms-based, graphics-based, etc.
DBMS Interfaces
• Web Browser as an interface
• Parametric interfaces (e.g., bank tellers)
• Speech input and output
• Interfaces for the DBA:
– Creating accounts, granting authorizations
– Setting system parameters
– Changing schemas or access path
Database system environment

24
Classification of DBMSs
• Based on the data model used
– Traditional: Network, Hierarchical.
– Emerging: Object-oriented, Object-relational.
• Other classifications
– Single-user (typically used with personal
computers) vs. multi-user (most DBMSs).
– Centralized (uses a single computer with one
database) vs. distributed (uses multiple
computers, multiple databases)
Example of Network Model Schema
Network Model
• Advantages:
– Network Model is able to model complex
relationships and represents semantics of
add/delete on the relationships.
– Can handle most situations for modeling using
record types and relationship types.
– Language is navigational; uses constructs like
FIND, FIND member, FIND owner, FIND NEXT
within set, GET, etc.
• Programmers can do optimal navigation through the
database.
Network Model
• Disadvantages:
– Navigational and procedural nature of processing
– Database contains a complex array of pointers
that thread through a set of records.
• Little scope for automated “query optimization”
Hierarchical DBMS
• The hierarchical model represents data as
hierarchical tree structures. Each hierarchy
represents a number of related records.
• There is no standard language for the
hierarchical model.
Hierarchical Model
• Advantages:
– Simple to construct and operate
– Corresponds to a number of natural hierarchically organized
domains, e.g., organization (“org”) chart
– Language is simple:
• Uses constructs like GET, GET UNIQUE, GET NEXT, GET NEXT
WITHIN PARENT, etc.
• Disadvantages:
– Navigational and procedural nature of processing
– Database is visualized as a linear arrangement of records
• Little scope for "query optimization"
Object-oriented Data Models
• Several models have been proposed for
implementing in a database system.
• One set comprises models of persistent O-O
Programming Languages such as C++ and Smalltalk.
Object-Relational Models
• Most Recent Trend. Started with Informix Universal
Server.
• Relational systems incorporate concepts from
object databases leading to object-relational.
• Exemplified in the latest versions of Oracle-10i,
DB2, and SQL Server and other DBMSs.
• Standards included in SQL-99 and expected to be
enhanced in future SQL standards.

You might also like