DBMS Flashcards
DBMS Architecture
SQL commands
|
Optimizer
|
Access method manager
|
Buffer manager — Concurrency control, Reliability Manager
|
Database (Index files, Data files)
— Reliability Manager
Optimizer
Generates execution strategy for a query
Access Method Manager
Implements execution strategy by performing physical access to data
Buffer Manager
Manages page/block transfer from disk to main memory and vice versa
Concurrency Control
Manages concurrent access to data
Reliability Manager
Guarantees content correctness after crashes
Rollback
The database goes back to the state at the beginning of the transaction, before the error
Commit
Correct end of a transaction
ACID properties
Atomicity
Consistency
Isolation
Durability
Atomicity
Transaction must be completed and not left at intermediate states of execution.
- Redo
- Undo
Consistency
Transaction should not violate integrity constrains enforced by a database schema
- Rollback
- Automatically correct the violation
Isolation
Transactions must not interfere.
- Concurrency control
Durability
Data not lost on failures
- Reliability manager
Fix primitive
Loads pages into the buffer.
If PAGE in buffer:
return Page Address
Else:
If free page available:
Store page in available space
Else:
Search for count=0
if dirty == 0: write on disk
else: store page in that space
Force primitive
Write ops immediately propagated to disk
Flush primitive
Write ops postponed until free buffer
Heap File
New records are inserted at the end. All space is exploited.
Frequent for unclustered (secondary) indices
Ordered Sequential Structures
Records inserted by sort key. Usually free space is left in every block to add transactions in an ordered way.
Frequent for clustered (primary) indices