Lec1 - Introduction To Database Systems
Lec1 - Introduction To Database Systems
Programmin
g
Fall 2024/2025
Lecture 1: Introduction to database systems
Dr. Samir Tartir
What is a database
Database is nothing
more than a collection In informatics, a
of information that database refers to a
exists over a long period collection of data that is
of time, often many managed by a DBMS.
years.
Database system
• Databases today are essential to every business.
• The power of databases comes from a body of knowledge
and technology that has developed over several decades
Introductio • This knowledge is embodied in specialized software called
n a database management system (DBMS)
• A DBMS is a powerful tool for
• Creating and managing large amounts of data efficiently
• Allowing it to persist over long periods of time, safely
Expectation of DBMS
Allow Give Support Enable Control
Allow users to Give users the Support the storage Enable durability Control access to
create new ability to query the of very large and the recovery of data from many
databases and data and modify the amounts of data the database. users at once:
specify their data, using an over a long period - Without allowing
schemas. appropriate of time; allowing unexpected
language. efficient access to interactions among
the data for queries users (isolation)
and database - Without actions on
modifications. the data to be
performed partially
but not completely
(atomicity).
Early DBMS
• The first commercial database management systems appeared in the late 1960’s evolving from
file systems
• File systems store data over a long period of time and allow the storage of large amounts of data
• File systems do not:
• Generally guarantee that data cannot be lost if it is not backed up
• Support efficient access to data items whose location in a particular file is not known
• Directly support a query language
• Satisfy control access to data from many users at once
• Support isolation and atomicity
• File systems support for a schema for the data is limited to the creation of directory structures for
file
Early DBMS
•Vulnerable to Inconsistency
• Change in one table need changes in
corresponding tables as well, otherwise data
will be inconsistent
Application of an early DBMS
Banking systems: maintaining accounts and making sure that system failures
do not cause money to disappear.
Airline reservation systems: require assurance that data will not be lost, and
they must accept very large volumes of small actions by customers.
Database
Management System
DBMS’s were large, expensive The size was necessary, because to store Today, hundreds of gigabytes fit on a
software systems running on large a gigabyte of data required a large single disk, and it is quite feasible to run
computers computer system. a DBMS on a personal computer.
Transaction processing
• It is normal to group one or more database operations into a
transaction, which is a unit of work
• Transaction, however, must be executed atomically and in
apparent isolation from other transactions
Transaction • In addition, a DBMS offers the guarantee of durability;
Processing • The work of a completed transaction will never be lost.
• The transaction manager therefore accepts transaction
commands from an application
• Tell the transaction manager when transactions begin and end
• Provide information about the expectations of the application
The transaction processor performs the following tasks:
Transaction 1. Logging
• In order to assure durability, every change in the database is logged separately on disk
• The log manager follows one of several policies designed to assure that no matter when a
system failure or “crash” occurs
• A recovery manager will be able to examine the log of changes, and
• restore the database to some consistent state
• The log manager initially writes the log in buffers and negotiates with the buffer manager
• To make sure that buffers are written to disk (where data can survive a crash) at appropriate times
Transaction Processing – Concurrency
Control
• The query compiler uses metadata and statistics about the data to decide which
sequence of operations is likely to be the fastest
• The execution engine has the responsibility for executing each
of the steps in the chosen query plan
Query • The execution engine interacts with most of the other
Answering: components of the DBMS, either directly or through the buffers
• The execution engine requests data from the buffer manager in order to
• The buffer manager’s task is to bring appropriate portions of the data from secondary
storage (disk) where it is kept permanently, to the main-memory buffers
• Normally, the page or (disk block) is the unit of transfer between buffers and disk
• The buffer manager communicates with a storage manager to get data from disk
• The storage manager might involve operating-system commands, but more typically, the
DBMS issues commands directly to the disk controller
Storage and Buffer Management
• The buffer manager is responsible for partitioning the available main memory into buffers, which are page-sized
regions into which disk blocks can be transferred
• All DBMS components that need information from the disk will interact with the buffers and the buffer manager,
either directly or through the execution engine
• The kinds of information that various components may need include:
1. Data: the contents of the database itself
2. Metadata: the database schema that describes the structure of, and constraints on, the database
3. Log Records: information about recent changes to the database; these support durability of the database
4. Statistics: information gathered and stored by the DBMS about data properties (e.g., sizes, values, etc.)
5. Indexes: data structures that support efficient access to the data
References
1. S. Abiteboul et al., “The Lowell database research self-
assessment,” Comm. AC M 48:5 (2005), pp. 111-118.
http://research.microsoft.com/~gray
/lowell/LowellDatabaseResearchSelfAssessment.htm
2. S. Abiteboul, R. Hull, and V. Vianu, Foundations of
Databases, Addison- Wesley, Reading, MA, 1995.
3. http://liinwww.ira.uka.de/bibliography/Database.
nt 6.
http://www.acm.org/sigmod/dblp/db/index.html.
M. Stonebraker and J. M. Hellerstein (eds.), Readings in
Database Systems, Morgan-Kaufmann, San Francisco, 1998.
7. M. Stonebraker, E. Wong, P. Kreps, and G. Held, “The design
and implementation of INGRES,” ACM Trans, on Database
Systems 1:3, pp. 189- 222, 1976.
8. J. D. Ullman, Principles of Database and Knowledge-Base
Systems, Volumes I and II, Computer Science Press, New
York, 1988, 1989.
Acknowledgment
Slides were prepared by Eng. Lina Hammad
Modified by Dr. Ala’a Al-Habashna