You are on page 1of 28

SISTEM BASIS DATA CS 3334

Introduction

Fakultas Informatika ITTelkom

2010

Topics • Definitions • File • Database • DBMS • File System vs DBMS •

Topics

Definitions
File
Database
DBMS
File System vs DBMS
Advantages of DBMS
History of database
DBMS Architecture

www.ittelkom.ac.id

Field Definitions Basic element of data (name, date, etc.) Record Collection of related fields that

Field

Definitions

Basic element of data (name, date, etc.)

Record

Collection of related fields that we treat as a unit (employee record) May be of a fixed or variable size

File

Data

www.ittelkom.ac.id

Collection of similar records Treated as an entity by applications Usually referenced by a name Access controls usually at file level

Known facts that can be recorded and have an implicit meaning.

Definitions Mini-world Some part of the real world about which data is stored in a

Definitions

Mini-world

Some part of the real world about which data is stored in a database. For example, student grades and transcripts at a university.

Database

Collection of related data files Relationships are explicit Used by a number of applications

Database System

www.ittelkom.ac.id

Database Management System (DBMS)

A software package/ system to facilitate the creation and maintenance of a computerized database.

The DBMS software together with the data itself. Sometimes, the applications are also included.

File System Architecture Device Drivers Communicate directly with device Basic File System Buffering, placing data

File System Architecture

Device Drivers

File System Architecture Device Drivers Communicate directly with device Basic File System Buffering, placing data on

Communicate directly with device

Basic File System

Buffering, placing data on device

Basic I/O Supervisor

I/O initiation and termination

www.ittelkom.ac.id
www.ittelkom.ac.id

Logical I/O – Deals with records Access method (pile, sequential, hashed, index)

Standard interface with the user

Elements of a File System Physical blocks in main memory buffers File structure A c

Elements of a File System

Physical blocks in main memory buffers

of a File System Physical blocks in main memory buffers File structure A c c e
of a File System Physical blocks in main memory buffers File structure A c c e

File structure Access method

memory buffers File structure A c c e s s method Physical blocks in secondary storage

Physical blocks in secondary storage (disk)

s s method Physical blocks in secondary storage (disk) Directory management Records Blocking Disk scheduling I/O
s s method Physical blocks in secondary storage (disk) Directory management Records Blocking Disk scheduling I/O

Directory

management

Records

Blocking

storage (disk) Directory management Records Blocking Disk scheduling I/O User & program commands File File
storage (disk) Directory management Records Blocking Disk scheduling I/O User & program commands File File
storage (disk) Directory management Records Blocking Disk scheduling I/O User & program commands File File
storage (disk) Directory management Records Blocking Disk scheduling I/O User & program commands File File
storage (disk) Directory management Records Blocking Disk scheduling I/O User & program commands File File
storage (disk) Directory management Records Blocking Disk scheduling I/O User & program commands File File
storage (disk) Directory management Records Blocking Disk scheduling I/O User & program commands File File
storage (disk) Directory management Records Blocking Disk scheduling I/O User & program commands File File

Disk

scheduling

Directory management Records Blocking Disk scheduling I/O User & program commands File File manipulatio n

I/O

User & program commands

File

Disk scheduling I/O User & program commands File File manipulatio n functions operations file name User
Disk scheduling I/O User & program commands File File manipulatio n functions operations file name User

File manipulatio n functions

operations file name User access control www.ittelkom.ac.id
operations
file name
User access
control
www.ittelkom.ac.id
file name User access control www.ittelkom.ac.id File allocation Free storage management File management

Filefile name User access control www.ittelkom.ac.id allocation Free storage management File management concerns

allocation

Free storage management

control www.ittelkom.ac.id File allocation Free storage management File management concerns Operating system concerns

File management concerns

Operating system concerns

Database • A database is a collection of related data • Essential database characteristics are:

Database

A database is a collection of related data

Essential database characteristics are:

Represents an aspect of the real world (miniworld),
Well structured (even has a strict regular structure),
Reflects (or should reflect) current state
Has users and applications,
Stored in a permanent (persistent) computer memory, and
Accessed and manipulated using a DBMS

www.ittelkom.ac.id

All these characteristics have to be met

Real World Database Ilustration Facts about world and behaviour of world represented in contents and

Real

World

Database Ilustration

Real World Database Ilustration Facts about world and behaviour of world represented in contents and operations
Facts about world and behaviour of world represented in contents and operations of a database
Facts about world and behaviour of world
represented in
contents and operations of a database
facts about the world in a database
more facts
some more rather long facts about the world in the databse
facts about the world in a database
more facts
some more rather long facts about the world in the databse
facts about the world in a database
more facts
some more rather long facts about the world in the databse
facts about the world in a database
more facts
some more rather long facts about the world in the databse
facts about the world in a database
more facts
some more rather long facts about the world in the databse
facts about the world in a database
more facts
some more rather long facts about the world in the databse
facts about the world in a database
more facts
Database
facts about the world in a database
more facts
Users
facts about the world in a database
more facts
facts about the world in a database
more facts
facts about the world in a database
facts about the world in a database
facts about the world in a database
facts about the world in a database
facts about the world in a database
facts about the world in a database
facts about the world in a database
facts about the world in a database
facts about the world in a database
facts about the world in a database
www.ittelkom.ac.id
Student A Sample Database LName FName StudId Major Smith Susan 131313 Comp Bond James

Student

A Sample Database

LName

FName

StudId

Major

Smith

Susan

131313

Comp

Bond

James

007007

Math

Smith

Susan

555555

Comp

Course CName CourId Hours Dept DB Sys C302 2+1 Comp SofEng C301 2+0 Comp DisMat
Course
CName
CourId
Hours
Dept
DB Sys
C302
2+1
Comp
SofEng
C301
2+0
Comp
DisMat
M214
4+1
Math
www.ittelkom.ac.id

Grade

StudId

CourId

Grade

007007

C302

A+

007007

C301

A

007007

M214

A+

131313

C301

B-

555555

C301

C

131313

C302

D

555555

C302

E

What Is a Database System ? • Database: a very large, integrated collection of data.

What Is a Database System?

Database:

a very large, integrated collection of data.

Models a real-world enterprise

Entities

(e.g. student lecturer)

,

,

Relationships

• • www.ittelkom.ac.id
www.ittelkom.ac.id

(e.g., The lecturers teach student)

More recently, also includes active components “business logic”)

(e.g.

A Database Management System (DBMS) is a software system designed to store, manage, and facilitate access to databases.

DBMS A collection of programs that enable: Defining (describing the structure), Constructing (populating by data),

DBMS

A collection of programs that enable:

Defining (describing the structure),

Constructing (populating by data),

Mani ulatin

(

q

uer in

y

u

datin )

g ,

p

g

g,

p

Preserving consistency,

Protecting from misuse,

Concurrent using

of a database.

www.ittelkom.ac.id

Recovering from failure, and

A simplified database system layout DBA Users/ Programmers Database Database System Description Application

A simplified database system layout

DBA Users/ Programmers Database Database System Description Application Programs/ Interactive Queries DBMS DDL
DBA
Users/
Programmers
Database
Database
System
Description
Application Programs/
Interactive Queries
DBMS
DDL
Data
Query Processor
Compiler
Access
Catalog
Database
www.ittelkom.ac.id
File System vs. DBMS • A company has 500 GB of data on employees, departments,

File System vs. DBMS

A company has 500 GB of data on employees, departments, products, sales, & so on
Data is accessed concurrently by several employees
Questions about the data must be answered quickly
Changes made to the data by different users must be applied consistently
Access to certain parts of the data be restricted

www.ittelkom.ac.id

File System vs. DBMS • Data stored in operating system files • Many drawbacks!!! •

File System vs. DBMS

Data stored in operating system files

Many drawbacks!!!

500 GB of main memory not available to hold all data. Data must be stored on secondary storage devices
Even if 500GB of main memory is available, with 32-bit addressing, we cannot refer directly to more than 4GB of data
Data redundancy and inconsistency Multiple file formats, duplication of information in different files
Special program to answer each question a user may ask

www.ittelkom.ac.id

File System vs. DBMS • Many drawbacks!!! • Integrity problems • Integrity constraints (e.g. account

File System vs. DBMS

Many drawbacks!!!

Integrity problems

Integrity constraints (e.g. account balance > 0) become “buried” in program code rather than being stated explicitly

Hard to add new constraints or change existing ones

We must protect the data from inconsistent changes made by different users. If application programs need to address concurrency, their complexity increases manifolds
Consistent state of data must be restored if the system crashes while changes are being made
OS provide only a password mechanism for security. Not flexible enough if users have permission to access subsets of data

www.ittelkom.ac.id

These drawbacks have prompted the development of database systems

Purpose of Database System • In the early days, database applications were built on top

Purpose of Database System

In the early days, database applications were built on top of file systems

Drawbacks of using file systems to store data:

Data redundancy and inconsistency

Multiple file formats, duplication of information in different files

Difficulty in accessing data

Need to write a new program to carry out each new task

www.ittelkom.ac.id

Data isolation — multiple files and formats Integrity problems

Integrity constraints (e.g. account balance > 0) become part of program code

Hard to add new constraints or change existing ones

Purpose of Database System Drawbacks of using file systems (cont.) Atomicity of updates • Failures

Purpose of Database System

Drawbacks of using file systems (cont.) Atomicity of updates

Failures may leave database in an inconsistent state with partial updates carried out

E.g. transfer of funds from one account to another should either complete or not happen at all

Concurrent access by multiple users

Security problems

www.ittelkom.ac.id

Concurrent accessed needed for performance

Uncontrolled concurrent accesses can lead to inconsistencies

o E.g. two people reading a balance and updating it at the same time

Database systems offer solutions to all the above problems

Advantages of a DBMS • Program-Data Independence • Insulation between programs and data: Allows changing

Advantages of a DBMS

Program-Data Independence

Insulation between programs and data: Allows changing data storage structures and operations without having to change the DBMS access programs.

Efficient Data Access

DBMS uses a variety of techniques to store & retrieve data efficiently

www.ittelkom.ac.id

Data Integrity & Security

Before inserting salary of an employee, the DBMS can check that the dept. budget is not exceeded
Enforces access controls that govern what data is visible to different classes of users

Advantages of a DBMS • Data Administration • When several users share data , centralizing

Advantages of a DBMS

Data Administration

When several users share data , centralizing the administration offers significant improvement

Concurrent Access & Crash Recovery

DBMS schedules concurrent access to the data in such a manner that users think of the data as being accessed by only one user at a time
DBMS protects users from the ill-effects of system failures

www.ittelkom.ac.id

Reduced Application Development Time

Many important tasks are handled by the DBMS

Databases Everywhere!!! • DBMS contains information about a particular enterprise • Collection of interrelated data

Databases Everywhere!!!

DBMS contains information about a particular enterprise

Collection of interrelated data

Set of programs to access the data

An environment that is both convenient and efficient to use

Database Applications:

Banking: all transactions

Airlines: reservations schedules

,

Universities: registration, grades
Sales: customers, products, purchases
Online retailers: order tracking, customized recommendations
Manufacturing: production, inventory, orders, supply chain
Human resources: employee records, salaries, tax deductions

www.ittelkom.ac.id

Databases touch all aspects of our lives

Levels of Abstraction • Physical level: describes how a record (e.g., customer) is stored. •

Levels of Abstraction

Physical level: describes how a record (e.g., customer) is stored.

Logical level: describes data stored in database, and the relationships among the data.

type customer = record

customer_id : string; customer_name : string; customer_street : string; customer_city : integer; end;

www.ittelkom.ac.id

View level: application programs hide details of data types. Views can also hide information (such as an employee’s salary) for security purposes.

View of Data Databases provide users with an abstract view of data www.ittelkom.ac.id

View of Data

Databases provide users with an abstract view of data

www.ittelkom.ac.id
www.ittelkom.ac.id
DML - DDL • DML/ query language • Language for accessing and manipulating the data

DML - DDL

DML/ query language

Language for accessing and manipulating the data organized by the appropriate data model

DDL Specification notation for defining the database schema

www.ittelkom.ac.id

History of Database Systems • 1950s and early 1960s: • Data processing using magnetic tapes

History of Database Systems

1950s and early 1960s:

Data processing using magnetic tapes for storage

Tapes provide only sequential access

Punched cards for input

Late 1960s and 1970s:

Hard disks allow direct access to data
Network and hierarchical data models in widespread use
Ted Codd defines the relational data model

www.ittelkom.ac.id

Would win the ACM Turing Award for this work
IBM Research begins System R prototype
UC Berkeley begins Ingres prototype

High-performance (for the era) transaction processing

1980s: History (cont.) Research relational prototypes evolve into commercial systems SQL becomes industrial standard

1980s:

History (cont.)

Research relational prototypes evolve into commercial systems

SQL becomes industrial standard

Parallel and distributed database systems Object-oriented database systems

1990s:

2000s:

www.ittelkom.ac.id

Large decision support and data-mining applications Large multi-terabyte data warehouses Emergence of Web commerce

XML and XQuery standards Automated database administration

Overall System Structure www.ittelkom.ac.id

Overall System Structure

www.ittelkom.ac.id
www.ittelkom.ac.id
Summary A database is a collection of related data that is well structured and stored

Summary

A database is a collection of related data that is well structured and stored permanently

A data is a value of an real object (or of a relationship between two objects) property in a perceived moment of time A DBMS is a set of programs that allows a comfortable database usage:

Declarative:

Defining Populating by data, Querying,

www.ittelkom.ac.id

Preserving consistency, Protecting from misuse, Recovering from failure, and Concurrent using

TERIMA KASIH www.ittelkom.ac.id

TERIMA KASIH

www.ittelkom.ac.id
www.ittelkom.ac.id