Tuple Oriented Storage
This note is complete, reviewed, and considered stable.
Storage Manager
The Storage Manager is a critical component of a Database Management System (DBMS) responsible for managing the physical storage and retrieval of data. It acts as an interface between the DBMS and the underlying storage devices, such as hard disk drives (HDDs) or solid-state drives (SSDs).
Key Functions of the Storage Manager:
- Data Storage: Allocates physical storage space for data and indexes.
- Data Retrieval: Retrieves data from storage based on user queries or application requests.
- Data Modification: Updates, inserts, and deletes data within the storage system.
- Concurrency Control: Ensures that multiple transactions can access and modify data simultaneously without conflicts.
- Recovery Management: Recovers the database to a consistent state in case of failures or errors.
Components of the Storage Manager:
- Buffer Manager: Manages a cache of data pages in memory to improve performance.
- File Manager: Organizes data into files and manages file structures.
- Page Manager: Handles the allocation and deallocation of pages within files.
- Access Methods: Provides mechanisms for efficiently accessing data, such as B-trees, hash indexes, and sequential scans.
- Concurrency Control Manager: Implements techniques like locking or timestamping to prevent conflicts.
- Recovery Manager: Maintains a log of transactions and uses it to undo or redo operations in case of failures.
Database Pages
Database pages are the fundamental units of data storage within a database system. They are fixed-size blocks of data that are read from and written to disk. Pages provide a structured and efficient way to organize and manage data.
Database Page Components
Each database page can be thought of as four main components: the Header, the Slot Directory, the Data Area, and the Free Space. Together, these components let the DBMS store variable-length tuples efficiently and handle inserts, updates, and deletes without layout changes to the schema.