0% found this document useful (0 votes)
3 views28 pages

Pertemuan 2 - Database Management Systems (DBMS)

The document provides an overview of Database Management Systems (DBMS), detailing their purpose, benefits, and various components such as data abstraction, query processing, transaction management, and storage management. It highlights the importance of DBMS in reducing data redundancy, ensuring data integrity, and facilitating concurrent access among users. Additionally, it classifies DBMS into categories like RDBMS and NoSQL, and outlines the roles of database users and administrators.

Uploaded by

eggi.122450032
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views28 pages

Pertemuan 2 - Database Management Systems (DBMS)

The document provides an overview of Database Management Systems (DBMS), detailing their purpose, benefits, and various components such as data abstraction, query processing, transaction management, and storage management. It highlights the importance of DBMS in reducing data redundancy, ensuring data integrity, and facilitating concurrent access among users. Additionally, it classifies DBMS into categories like RDBMS and NoSQL, and outlines the roles of database users and administrators.

Uploaded by

eggi.122450032
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 28

Database

Management
Systems (DBMS)
Ahmad Luky Ramdani. S.Kom, M.Kom
Ira Safitri, M.Si.
Rohmi Dyah Astuti, S.Si., M.Cs.
Yuliana, M.Cs.
Persentase Penilaian

a. Ujian Tengah Semester 25%

b. Ujian Akhir Semester 25%

c. Praktikum 20%

d. Tugas 20%

e. Kuis 10%
Database Management System
• A database-management system (DBMS) is a collection of interrelated
data and a set of programs to access those data.
• The primary goal of a DBMS is to provide a way to store and retrieve database
information that is both convenient and efficient.
• Database systems are designed to manage large bodies of information.
• Database applications:
• Banking: all transactions
• Airlines: reservations, schedules
• Universities: registration, grades
• Sales: customers, products, purchases
• Manufacturing: production, inventory, orders, supply chain
• Human resources: employee records, salaries, tax deductions
Why we need database system?
• Data redundancy and inconsistency
o Multiple file formats, duplication of information in
different files
• Difficulty in accessing data
o Need to write a new program to carry out each new task
• Data isolation — multiple files and formats
• Integrity problems
o Integrity constraints (e.g. account balance > 0) become part of
program code
o Hard to add new constraints or change existing ones
Why we need database system?
(cont.)
• Atomicity of updates
o Failures may leave database in an inconsistent state with
partial updates carried out
o E.g. transfer of funds from one account to another should
either complete or not happen at all
• Concurrent access by multiple users
o Concurrent accessed needed for performance
o Uncontrolled concurrent accesses can lead to
inconsistencies
o E.g. two people reading a balance and updating it at the same time
• Security problems
Why Use a DBMS?
• Data independence and efficient access
• Reduced application development time
• Data integrity and security
• Uniform data administration
• Concurrent access, recovery from crashes
View of Data

Data Abstraction
• Physical level. The lowest level of abstraction describes how
the data are actually stored. The physical level describes
complex low-level data structures in detail.
• Logical level. The next-higher level of abstraction describes
what data are stored in the database, and what relationships
exist among those data.
• View level. The highest level of abstraction describes only part
of the entire database. Even though the logical level uses simpler
structures, complexity remains because of the variety of
information stored in a large database.
Data Abstraction
Instances and Schemas
• Similar to types and variables in programming
languages
• Schema – the logical structure of the database
• e.g., the database consists of information about a set
of customers and accounts and the relationship
between them)
• Analogous to type information of a variable in a
program
• Physical schema: database design at the physical
level
• Logical schema: database design at the logical level
• Instance – the actual content of the database at
a particular point in time
Instances and Schemas (cont.)

• Physical Data Independence – the ability to


modify the physical schema without changing
the logical schema
• Applications depend on the logical schema
• In general, the interfaces between the various levels
and components should be well defined so that
changes in some parts do not seriously influence
others.
Query Processing
1. Parsing and translation
2. Optimization
3. Evaluation
Query Processing (cont.)
• Alternative ways of evaluating a given query
• Equivalent expressions
• Different algorithms for each operation
• Cost difference between a good and a bad way of
evaluating a query can be enormous
• Need to estimate the cost of operations
• Depends critically on statistical information about
relations which the database must maintain
• Need to estimate statistics for intermediate results to
compute cost of complex expressions
Transaction Management
• A transaction is a collection of operations that
performs a single logical function in a database
application
• Transaction-management component ensures that the
database remains in a consistent (correct) state
despite system failures (e.g., power failures and
operating system crashes) and transaction failures.
• Concurrency-control manager controls the
interaction among the concurrent transactions, to
ensure the consistency of the database.
Transaction: An Execution of a DB
Program
• Key concept is transaction which is an atomic
sequence of database actions (reads/writes)
• Each transaction, executed completely, must
leave the DB in consistent state if DB is
consistent when the transaction begins
• Users can specify some simple integrity constraints on
the data and the DBMS will enforce these constraints
• Beyond this, the DBMS does not really understand the
semantics of the data (e.g. it does not understand how
the interest on a bank account is computed)
• Thus, ensuring that a transaction (run alone) preserves
consistency is ultimately the user’s responsibility
Concurrency Control
• Concurrent execution of user programs is essential
for good DBMS performance
• Because disk accesses are frequent and relatively slow, it is
important to keep the CPU humming by working on several
user programs concurrently
• Interleaving actions of different user programs can
lead to inconsistency: e.g. check is cleared while
account balanced is being computed
• DBMS ensures such problems don’t rise: users can
pretend they are using a single-user system
Scheduling Concurrent Transactions
• DBMS ensures that execution of {T1, …, Tn} is
equivalent to some serial execution T1’, …, Tn’
• Before reading/writing an object, a transaction requests a
lock on the object, and waits till the DBMS gives it a lock.
All locks are released at the end of the transaction (Strict
2PL locking protocol)
• Idea: If an action of Ti (say, writing X) affects Tj (which
perhaps reads X), one of them, say Ti, will obtain the lock
on X first and Tj is forced to wait until Ti completes; this
effectively orders the transactions
• What if Tj already has a lock on Y and Ti later requests a
lock on Y? (Deadlock!) or Ti is aborted and restarted!
Ensuring Atomicity
• DBMS ensures atomicity (all-or-nothing property) even
if system crashes in the middle of a transaction
• Idea: Keep a log (history) of all actions carried out by
the DBMS while executing a set of transactions
• Before a change is made to the database the corresponding
log entry is forced to a safe location (WAL protocol: OS
support for this is often inadequate)
• After a crash, the effects of partially executed transactions
are undone using the log (Thanks to WAL, if log entry wasn’t
saved before the crashed, corresponding change was not
applied to database!)
Storage Management
• Storage manager is a program module that provides
the interface between the low-level data stored in the
database and the application programs and queries
submitted to the system.
• The storage manager is responsible to the following
tasks:
• interaction with the file manager
• efficient storing, retrieving and updating of data
Classification DBMS
1. RDBMS - 2. NoSQL - Not Only
Relational data SQL
base menejement • Classification
system • Key-Value Stores
• Most Popular • Wide Column
Stores
• Oracle
• Document Stores
• MySQL
• Graph DBMS
• Microsoft SQL
Server • RDF Stores
• PostgreSQL • Native XML DBMS
• IBM Db2 • Content Stores
• Search Engines
Classification DBMS (Cont.)
1. ACID
• Atomicity – all or
nothing
• Consistency
• Isolation
• Durability
2. BASE
• Basic available –
availability
• Soft state – flexibility
and dynamic
• Eventually Consistent
Overall Structure
Database Users
• Users are differentiated by the way they expect to interact with
the system
• Application programmers – interact with system through DML
calls
• Sophisticated users – form requests in a database query
language
• Specialized users – write specialized database applications that
do not fit into the traditional data processing framework
• Naïve users – invoke one of the permanent application programs
that have been written previously
• E.g. people accessing database over the web, bank tellers, clerical staff
Database Administrator
• Coordinates all the activities of the database system;
the database administrator has a good understanding
of the enterprise’s information resources and needs.
• Database administrator's duties include:
• Schema definition
• Storage structure and access method definition
• Schema and physical organization modification
• Granting user authority to access the database
• Specifying integrity constraints
• Acting as liaison with users
• Monitoring performance and responding to changes in
requirements
Database Users and Administrators

Database
Structure of a DBMS
• A typical DBMS has a layered
architecture
• The figure does not show the
concurrency control and
recovery components
• This is one of several possible
architectures
• Each system has its own
variations
Application Architectures
 Two-tier architecture: E.g. client programs
using ODBC/JDBC to
communicate with a database
 Three-tier architecture: E.g. web-based
applications, and
applications built using “middleware”
Application Architectures
Databases make these folks happy…

• End users and DBMS vendors


• DB application programmers
• E.g. smart webmasters
• Database Administrator (DBA)
• Designs logical/physical schemas
• Handles security and authorization
• Data availability, crash recovery
• Database tuning as needs evolve
• Must understand how a DBMS
works!

You might also like