You are on page 1of 5

DBMS

DBMS Database Management Systems


Oracle, Sybase, Access, MySQL, SAP, BAAN

DBMS
Corporate databases often extent to hundreds of Gb.
Terrabytes of data provide a good history Retailers use this to plan and determine market trends.

Originally
Large, expensive systems

Storage has got smaller and cheaper


Became practical to have a DBMS on a PC

As object-oriented Db become a reality, storage requirements grow.


One hour of video takes 1Gb
1 February 05 DBMS Architecture 2

February 05

DBMS Architecture

DBMS
Will be extending to petabytes (1000 terabytes or 1000 1000 gigabtyes) This type of storage requires tertiary storage and parallel computing. Tertiary Storage
Multiple disks, larger disks Require longer access times (maybe up to several seconds)
CDs stacked and selected by a robot arm
February 05 DBMS Architecture 3 February 05

DBMS
Parallel computing
True parallel computing allows for quicker access to large amounts of data. Read many queries at the same time

However,
May also need to break the queries into subqueries to make efficient use of all resources

DBMS Architecture

DBMS Architecture
Fundamental characteristic
Allows many different uses for the same data Data not tied or controlled by any single application
Shared among many users and applications

DBMS Architecture
When the data is shared,
Different applications access different parts of the data
Stock control stock files Order processing parts of stock, customers and invoice files, and also orders files.

Achieved by removing responsibility for creating and maintaining the stored data to the DBMS which acts as a controlling layer between the applications and the data.
February 05 DBMS Architecture 5

The subset of the database is referred to as a View


Set up by the DBA DBMS supports multiple views of the same data sets

February 05

DBMS Architecture

DBMS Architecture
The data stored may be used by many applications at the same time concurrency.
DBMS must provide and control concurrent access. If not controlled, the data may be corrupted
Two applications update at the same time.

DBMS Architecture
Security from unwarrented intrusion Should be able to restore data in event of a breakdown. Data integrity is maintained
DB establishes the format of the data and all applications have to use this format. Originally, files could have same data with different formats.
February 05 DBMS Architecture 8

Security and integrity of the DB should also be maintained


February 05 DBMS Architecture 7

DBMS Architecture
Parts of the system
Area for data storage
Contains the data and the metadata. Will also contain indexes to speed up searching (more on these later)

DBMS Architecture
Transaction Manager
Responsible fo rthe integrity of the system
Must assure that queries do not interfere with each other and that the system will not lose data in the event of a failure. Interacts with the query manager to determine potential conflicts in data being manipulated. Interacts with the storage manager to keep log files of all transactions.
9 February 05 DBMS Architecture 10

Storage Manager
Requests information from the data storage and modifies the information when requested to by the levels above it.
February 05 DBMS Architecture

DBMS Architecture
Query Processor
Handles queries, modification requests for data and metadata Finds the best way to carry out a requested operation and issues commands to the storage manager to carry them out.

Schema Modifications

Queries

Modifications

Query Processor Transaction Manager Storage Manager

Diagram to show these components


Data Metadata
February 05 DBMS Architecture 11 February 05 DBMS Architecture 12

DBMS Architecture
Three types of input
Query
Questions about data from a generic query interface (SQL command line) Questions from application program interfaces

Storage Manager
In simple systems, this will be the file system of the underlying OS. In larger systems, the DBMS controls storage on the disk directly. Broken into two parts buffer manager, file manager
File manager manages location of files on disks and obtains the blocks required on request. Buffer manager manages main memory, receiving the blocks and bringing pages in and out of memory.
February 05 DBMS Architecture 14

Modifications
To change the data, requests from the same possible sources

Schema Modifications
Usually from authorised personnel to change the schema or to create a new database
February 05 DBMS Architecture 13

Query Manager
Translates the english queries into an efficient sequence of requests to return the data. Example: two tables
Customers customer names, PPS and address Accounts account number, balance and PPS of owner.

Transaction Manager
Transactions are elementary units of work on the database One of the guarantees of a DBMS is to never lose data.
TM maintains a log of all operations carried out.

Query find all accounts owned by X


Have to search first for the PPS number of X and then find all of the accounts with that PPS number Number of disk access will depend on the existence of an index.
February 05 DBMS Architecture 15

Frequently, many transactions execute concurrently


Proper execution requires ACID properties Atomicity, Consistency, Isolation, Durability
February 05 DBMS Architecture 16

Transaction Manager
Atomicity either all of the transaction is executed or none of it is. Consistency a consistent state is one in which the data meets any expectations we may have.
The expected state may be temporarily violated, but must be restored after all transactions are complete
February 05 DBMS Architecture 17

Transaction Manager
Isolation when two or more transactions run concurrently, the effects must be isolated from each other.
Should not see effects caused by the two transactions running concurrently that would not occur if they ran in series.

Durability effect of a completed transaction should not be lost.


February 05 DBMS Architecture 18

Enforcing ACID
Common techniques include Locking, Logging and Transaction Commitment. Locking
Generally, the item that the transaction is accessing is locked to some degree. When locked, access is restricted to avoid overwriting Two transactions try to access the same record for update will cause a conflict.
February 05 DBMS Architecture 19

Enforcing ACID
Logging
Transactions initiated, changes caused by transactions, end of each transaction All recorded by the transaction manager Always written to non volatile storage (will survive power failure) Important in assuring durability

February 05

DBMS Architecture

20

Enforcing ACID
Transaction Commitment
Usually the log is written before the data is committed to the database. When the transaction is ready to complete, the changes are in the log.
The log is then copied to disk and then the chages are made in the database.

Enforcing ACID
Transaction Commitment
Normally done in a tentative way Changes are computed, but not actually made. First copied to a log, and then database is changed. If system fails between two steps
Can still be recovered

In the event of failure between the steps, the changes can still be committed.
February 05 DBMS Architecture 21

Failure before completion


Can be redone safely
February 05 DBMS Architecture 22

Client Server
Simplest form entire database is the server, except for the query interace that interacts with the user. Query sent from the client using SQL to represent the request.
Server generates data and returns to the client.

Constraints
Boolean valued functions whose value must be true.
A bank balance has a constraint to be greater than or equal to zero. Any transaction that threatens to violate this constraint is rejected.

February 05

DBMS Architecture

23

February 05

DBMS Architecture

24

Triggers
A piece of code that is executed when a particular event occurs.
Insertion or deletion of a certain data item. When a flight status is changed to cancelled, a query may be run to fine passenger details to notify them
Could be extended to try an find alternative flights for them.
February 05 DBMS Architecture 25

Multimedia data
Has forced expansion.
Operations on multimedia data are not as simple as traditional data formats. Try searching for pictures that shoe people with green eyes. May have to let uses add functions that may apply to multimedia data.

February 05

DBMS Architecture

26

Multimedia Data
Size of the data is also a problem
Sending 1Gb of data to a user may not be feasible.
Set up delivery on demand or fixed rate delivery system What the client wants may be in the middle and they could stop transmission when the piece is received.

Data Integration
Combining already existing databases (divisional) may be difficult
Differences in data, standards for same data Often a data warehouse is used to select the relevant pieces from the legacy systems and present a unified vew to someone (customer perhaps). Legacy systems keep working in their own environment
Warehouse gets updated periodically.

February 05

DBMS Architecture

27

February 05

DBMS Architecture

28

You might also like