Download as pdf or txt
Download as pdf or txt
You are on page 1of 61

Introduction

 Database: A collection of related data.


 Data: Known facts that can be recorded and have an implicit
meaning.
 Database Management System (DBMS): A software package/
system to facilitate the creation and maintenance of a
computerized database.
 Mini-world: Some part or aspect of the real world about
which data is stored in a database. For example, student
grades and transcripts at a university.

Introduction to Database Systems


Example of a Database
(with a Conceptual Data Model)
 Mini-world for the example: Part of a
UNIVERSITY environment.
 Some mini-world entities:
 STUDENTs
 COURSEs
 SECTIONs (of COURSEs)
 (academic) DEPARTMENTs
 INSTRUCTORs
The above could be expressed in the ENTITY-
RELATIONSHIP data model.
Example of a Database
(with a Conceptual Data Model)
 Some mini-world relationships:
 SECTIONs are of specific COURSEs
 STUDENTs take SECTIONs
 COURSEs have prerequisite COURSEs
 INSTRUCTORs teach SECTIONs
 COURSEs are offered by DEPARTMENTs
 STUDENTs major in DEPARTMENTs

The above could be expressed in the ENTITY-


RELATIONSHIP data model.
Database System
 Computerized record-keeping system
 Supports operations
 Add or delete files to the database
 Insert, retrieve, remove, or change data in database
 Components
 Data, hardware, software, users

Introduction to Database Systems


A Simplified Database System
Environment

Introduction to Database Systems


Database System - Data
 May support single or many users
 Many users in organizations
 Data is integrated
 Data is shared
 Different users will require different views

Introduction to Database Systems


Database System - Hardware
 Data is stored on Disk
• Direct access to subset portions
• Rapid I/O
 Data operated on in main memory

Introduction to Database Systems


Database System - Software

 Database manager or Database server or


Database management system (DBMS)
 Application programs, database tools and
utilities like report generation tool

Introduction to Database Systems


Database System - Software

 DBMS is not ( but may come with)


 Application Development Tools
 Application Software
 TP Monitor
 Report Writer
 System utilities

Introduction to Database Systems


Typical DBMS Functionality
 Define a database : in terms of data types, structures and
constraints
 Construct or Load the Database on a secondary storage
medium
 Manipulating the database : querying, generating reports,
insertions, deletions and modifications to its content
 Concurrent Processing and Sharing by a set of users and
programs – yet, keeping all data valid and consistent

Introduction to Database Systems


Typical DBMS Functionality
Other features:
 Protection or Security measures to prevent
unauthorized access
 “Active” processing to take internal actions on data
 Presentation and Visualization of data

Introduction to Database Systems


Database System - Users

 Application programmers
 End users
 Database Administrators

Introduction to Database Systems


Application programmers

 System Analysts determine the requirements


of end users and prepare specificati0n for
canned transactions that meet those
requirements
 Application programmers implement these
specifications , test, debug, and maintain
these transactions

Introduction to Database Systems


Database Users
 Database administrators: responsible for
authorizing access to the database, for co-
ordinating and monitoring its use, acquiring
software, and hardware resources, controlling its
use and monitoring efficiency of operations.
 Database Designers: responsible to define the
content, the structure, the constraints, and functions
or transactions against the database. They must
communicate with the end-users and understand
their needs.
Categories of End-users
End-users: they use the data for queries, reports and
some of them actually update the database content.
 Casual : access database occasionally when needed
 Naïve or Parametric : they make up a large section of
the end-user population. They use previously well-
defined functions in the form of “canned transactions”
against the database. Examples are bank-tellers or
reservation clerks who do this activity for an entire
shift of operations.
Categories of End-users
 Sophisticated : these include business analysts,
scientists, engineers, others thoroughly familiar
with the system capabilities. Many use tools in
the form of software packages that work closely
with the stored database.
 Stand-alone : mostly maintain personal
databases using ready-to-use packaged
applications. An example is a tax program user
that creates his or her own internal database.
Traditional File Processing
Approach
 Data files
 Application programs
Main Characteristics of the
Database Approach
 Self-describing nature of a database system: A
DBMS catalog stores the description of the
database. The description is called meta-data).
This allows the DBMS software to work with
different databases.
 Insulation between programs and data: Called
program-data independence. Allows changing
data storage structures and operations without
having to change the DBMS access programs.
Data Abstraction: A data model is used to
hide storage details and present the users
with a conceptual view of the database.
Main Characteristics of the
Database Approach
 Support of multiple views of the data: Each user
may see a different view of the database, which
describes only the data of interest to that user.
 Sharing of data and multiuser transaction
processing : allowing a set of concurrent users to
retrieve and to update the database. Concurrency
control within the DBMS guarantees that each
transaction is correctly executed or completely
aborted. OLTP (Online Transaction Processing) is
a major part of database applications.
Advantages of Database Approach
 Shared data
 Reduced (or controlled) redundancy
 Reduced inconsistent data
 Transaction support

Introduction to Database Systems


Advantages of Database Approach
 Support for data integrity
 Security enforcement
 Support for standards
 Conflicting requirements can be met

Introduction to Database Systems


Historical Development of
Database Technology
 Early Database Applications: The
Hierarchical and Network Models were
introduced in mid 1960’s and dominated
during the seventies. A bulk of the worldwide
database processing still occurs using these
models.
 Relational Model based Systems: The
model that was originally introduced in 1970
was heavily researched and experimented with
in IBM and the universities. Relational DBMS
Products emerged in the 1980’s.
Historical Development of
Database Technology
 Object-oriented applications: OODBMSs
were introduced in late 1980’s and early 1990’s
to cater to the need of complex data
processing in CAD and other applications.
Their use has not taken off much.
 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
standards like XML (eXtended Markup
Language).
Extending Database Capabilities
 New functionality is being added to
DBMSs in the following areas:
 Scientific Applications
 Image Storage and Management
 Audio and Video data management
 Data Mining
 Spatial data management
 Time Series and Historical Data Management
 Software packages that work closely with
database back-ends
 ERP (Enterprise Resource Planning)
 CRM (Customer Relationship Management)
When not to use a DBMS
 Main inhibitors (costs) of using a DBMS:
 High initial investment and possible need for
additional hardware.
 Overhead for providing generality, security,
concurrency control, recovery, and integrity
functions.
 When a DBMS may be unnecessary:
 If the database and applications are simple, well
defined, and not expected to change.
 If there are stringent real-time requirements that
may not be met because of DBMS overhead.
 If access to data by multiple users is not required.
When not to use a DBMS
 When no DBMS may suffice:
 If the database system is not able to handle the
complexity of data because of modeling limitations
 If the database users need special operations not
supported by the DBMS.
Data Models
 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.
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-based or
object-based data models.)
 Physical (low-level, internal) data models:
Provide concepts that describe details of how data
is stored in the computer.
 Implementation (representational) data
models: Provide concepts that fall between the
above two, balancing user views with some
computer storage details.
Schemas versus Instances
• 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).
Schema Diagram

Introduction to Database Systems


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.
• Distinction
• The database schema changes very infrequently. The
database state changes every time the database is updated.
• Schema is also called intension, whereas state is called
extension.
Three-Schema Architecture
• Defines DBMS schemas at three levels:
• Internal schema at the internal level to describe
physical storage structures and access paths. 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 a conceptual or an
implementation data model.
• External schemas at the external level to describe the
various user views. Usually uses the same data model as
the conceptual level.
Three-Schema Architecture

Introduction to Database Systems


External Level
 May support single or groups of users
 Different users will require different views
 Implemented via conceptual VDL

Introduction to Database Systems


Conceptual Level
 Global logical representation
 Shared by all users
 Underlying meaning of the data
 Foundation for database design
 Defined by conceptual schema
 Implemented via conceptual DDL

Introduction to Database Systems


Internal Level
 Physical layer
 Blocks, pages, I/O
 Described by internal schema, DDL (SDL)
 Hardware dependent
 Includes structures such as hash, heap, B-tree
 Includes pointers

Introduction to Database Systems


Mappings
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.
 Conceptual/internal
 Implementation of logical design
 External/conceptual
 Overlapping subsets of views
 External/external
 Views mapped to views

Introduction to Database Systems


Data Independence
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.
Data Independence
• Logical Data Independence: The capacity to change
the conceptual schema without having to change the
external schemas and their application programs.
• Physical Data Independence: The capacity to
change the internal schema without having to change
the conceptual schema.
DBMS Languages
• Once the database design is complete, conceptual and
internal schema and mapping is specified
• IN DBMS, where no strict separation is made between
levels, one language Data Definition Language (DDL) is
used to specify both schema by DBA and database
designers
• In many DBMSs, the DDL is also used to define external
schemas (views).
• DBMS has DDL complier which process the statements of
DDL and stores the schema in the DBMS catalog
DBMS Languages
• In DBMS where separation is made between
levels
• Data Definition Language (DDL) is used by the DBA
and database designers to specify the conceptual schema
of a database
• Separate storage definition language (SDL) is used to
define internal schema.
• Separate View definition language (VDL) is used to define
external schema.
DBMS Languages
 No specific SDL
 DBA use some tools, utilities and some SQL statements
to define internal schema
 No specific VDL also
 Practically in most DBMS, DDL is also used to specify
external schema
 SQL is a comprehensive integrated language that
contains DDL, SDL, VDL statements

Introduction to Database Systems


DBMS Languages
• Data Manipulation Language (DML): Used to
specify database retrievals and updates.
Types of DMLs
• Low Level DML or Procedural Languages: record-at-a-time;
• Must be embedded in a high level general purpose language
• they specify how to retrieve data
• Example: DL/1 (designed for hierarchical model, process one record
at a time)
• High Level DML or Non-procedural Languages: are set-oriented
• specify what data to retrieve than how to retrieve.
• Must be embedded in a high level general purpose language
• Also called declarative languages.
• Example: SQL
DBMS Languages
• When Data Manipulation Language (DML)
statements whether high level or low level are
embedded in a general purpose high level language
like C, COBOL is called data sublanguage
• High level language is called host language
• When stand-alone DML commands are used directly, it
is called query language.
DBMS: Component Modules
 DDL compiler
 DML compiler
 Stored Data Manager
 Query Optimizer
 Run-time Database Processor/manager
 Security and integrity
 Concurrency control/ backup/recovery Subsystem
 Data dictionary
 Performance tuning utilities

Introduction to Database Systems


Component diagram of DBMS

Introduction to Database Systems


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.
• External tool support: query, reports, graphics,
spreadsheets, statistics
Classification of DBMSs
• Based on the data model used at conceptual level:
• Traditional: Relational (MySQL, Oracle etc.), Network
(Univac DMS-1100, IMAGE, IDMS, openVMS etc.),
Hierarchical (IBM’s Information Control System and
Data Language/Interface (ICS/DL/I), IBM’s IMS).
• Emerging: Object-oriented (Vbase (O2), JADE,
ObjectDB, lambdaDB, GemStone), Object-relational
(UniSQL, Omniscience).
• IBM's DB2, Oracle database, and Microsoft SQL Server
Classification of DBMSs
• Other classifications:
• Single-user (typically used with micro- computers) vs.
multi-user (most DBMSs).
• Centralized (uses a single computer with one database)
vs. distributed (uses multiple computers, multiple
databases)
Variations of Distributed
Environments:
• Homogeneous DDBMS
• Heterogeneous DDBMS
 Federated or Multidatabase Systems-middleware
software to access several autonomous preexisting
databases stored under heterogeneousDBMSs
DBMS Architectures
• Centralized DBMS: combines everything into single
system including- DBMS software, hardware,
application programs and user interface processing
software.
• Terminals having mostly
Display capabilities access
Centralized DBMS
DBMS Architectures: Two Tier
Client-Server Architecture
• Basic Client-Server Architectures
• Client provide appropriate interfaces to access and
utilize the server resources
• DBMS Server Provides database query and transaction
services to the clients (sometimes called query and
transaction servers)
• Clients connected to the servers via some form of a
network.
• DBMS Two Tier Client-Server Architectures
• User Interface Programs and Application Programs run on the
client side
DBMS Architectures: Two Tier
Client-Server Architecture
• 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.
• 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.
Two Tier Client-Server
Architecture

Introduction to Database Systems


DBMS Architectures: 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

Introduction to Database Systems


Database Administrator and Data Administrator
 In DBMS, there is centralized control over data
 The person who has this central responsibility is data
administrator
 Data Administrator (DA)
 Understand data and need of the enterprise wrt data at
senior management level
 decide what data should be stored in database,
establish policies maintaining and dealing with data
 Eg. Security policy: who can perform what operations on
what data

Introduction to Database Systems


Database Administrator and Data Administrator
 Database Administrator (DBA)
 DA is a manager, he/she only decides policies
 Technical person(s) responsible for implementing the
decisions made by DA is Database Administrator (DBA)
 DBA is and IT professional
 Create actual database, implements all controls needed
to enforce policy decisions
 Ensure that database system provides adequate
performance and provides all kind of technical support
 DBA has a team of system programmers and technical
assistants

Introduction to Database Systems


Role of Database Administrator (DBA)
 Participates in conceptual database design and
create the conceptual schema
 Defining the internal schema
 Liaising with users (Teach users, and help them
report)
 Implement security and integrity
 Implement unload/reload utilities
 Monitor and tune database performance

Introduction to Database Systems

You might also like