Lecture 01 Fundamental Database Concepts PDF
Lecture 01 Fundamental Database Concepts PDF
Lecture 01 Fundamental Database Concepts PDF
LECTURE 1
FUNDAMENTAL DATABASE CONCEPTS
WHAT IS A DATABASE?
customer records
employee records
billing information
management records
Access by a collection
of ad hoc programs
in C++, Java, PHP, etc.
users of
the data
There is no control or
coordination of what
these programs do
data stored as bits on disks
organized as files with the data
WHY USE A DBMS?
DBMS users of
the data
application
application
program(s)
application
program(s)
application
program(s) users of
program(s)
the data
external/application view
internal/implementation view
query processor
security manager
DBMS
software concurrency manager
components index manager
data
data definition data
description processor data
dictionary
DBMS LANGUAGES
application
application
DML: data manipulation language application
program(s)
application
program(s) users of
QL: query language program(s)
program(s) the data
GPL: general purpose languages
query processor
security manager
concurrency manager system
index manager configuration
languages
DDL:
data data
definition definition data
language processor data
dictionary
ADVANTAGES OF USING A DBMS
• for applications in this class, the DBMS already has these capabilities
and probably does them better than you could with home-brewed
code
DATABASE
FUNCTIONALITY
ADVANTAGES OF USING A DBMS
application
application
application
program(s)
application
program(s) users of
program(s)
program(s) the data
query processor
software operating
security manager
between the data and
concurrency manager the applications can
index manager provide many
capabilities
in a generic way
data
definition data
processor data
dictionary
PERSISTENCE
• A DBMS provides
persistent objects, types and data structures
• since the DBMS understands the data structure, it can enforce fairly
sophisticated and detailed security policies
• on subsets of the data
• on subsets of the available operations
REDUNDANCY CONTROL
• with file storage, it's often convenient to store multiple copies of the
same data, so that it's "local" to other data and applications
• since the DBMS provides a well-defined data model and a persistent data
dictionary, many different interfaces can be developed to access the same
data
• data independence ensures that these UIs will not be made invalid by most
changes to the data
• new user views can be supported as new schemas defined against the
conceptual schema
ADVANTAGES OF USING A DBMS
query processor
DBMS security manager
system concurrency manager
developers index manager system
database administrator
(and DB
designer data
designer)
definition data
processor data
dictionary
DBMS ROLES
• database administrators
• database designers
• systems analysts and application programmers
• end users
ACTORS ON THE SCENE
• Database Administrators
• acquiring a DBMS
• managing the system
• acquiring HW and SW to support the DBMS
• authorizing access (security policies)
• managing staff, including DB designers
ACTORS ON THE SCENE
• Database Designers
• End Users
• sophisticated users: people who understand the system and the data
and use it in many novel ways
• Tools Developers
• Database Researchers
• develop new theory, new designs, new data models and new
algorithms to improve future database management systems
DATA
ORGANIZATION
SCHEMAS AND INSTANCES
user-specific
views
Account
No s PIN Balance constraint:
896 account.Balance must be non-negative
101 10965.78
664
5
387 652.55
3 any transaction withdrawing
543 4287 8720.12
more than $652.55 from acct 387
will violate this constraint
Account Account
No s PIN Balance No s PIN Balance
896 896
101 10965.78 101 10965.78
664
5 664
5
387 652.55 387 652.55
3 3
543 4287 8720.12 543 4287 10233.35
Combined result of both
transactions must be correct
TRANSACTIONS ARE ISOLATED
happen
• Ensuring isolation is the task of concurrency control
concurrently
DURABLE TRANSACTIONS
• Wilma deposits $50,000 to account 387.
• Later, the bank’s computer crashes due to a lightning storm.
Account Account
No s PIN Balance No s PIN Balance
896 896
101 10965.78 101 10965.78
664
5 664
5
387 652.55 387 50652.55
3 3
543 4287 8720.12 543 4287 8720.12
• Sources of failure:
• computer or operating system crash
• disk failure
• fire, theft, power outage, earthquake, operator errors, …
TRANSACTIONS • transaction = an indivisible unit of
data processing