Chapter 1 Flashcards
1
Q
Schema
A
- logical structure of the data
- includes logical constraints such as table names, fields, data types and relationships between these entities
- example: table or relation with columns for a student, course taken, and grade (only allowable grades are A, B, C, D, F)
2
Q
Database
A
- collection of information that exists over a long period of time
- collection of data that is managed by a DBMS
3
Q
Database Management System (DBMS)
A
- software for creating and managing large amounts of data efficiently and allowing it to persist over long periods of time
- storing and retrieving data
4
Q
DBMS expected functions
A
- create new databases and specify their schemas using a specialized data-definition language
- Query and modify data using a query language or data-manipulation language
- Support large amounts of data
- Durability, or the recovery of the database in case of failures or intentional misuse
- Control access to data from many users at once: isolation and atomicity
5
Q
Relational Database Systems
A
- database systems should present the user with a view of data organized as tables called relations
- programmer of a relational system would not be concerned with the storage structure
- queries could be expressed in a high-level language
- SQL(Structured Query Language) is most important query language based on the relational model
6
Q
Information Integration
A
- joining the information contained in many related databased into a whole
- divisions of a company may use a different DBMS and different structures for information
- popular approach is the creation of data warehouses, where info from legacy databases is copied periodically with the appropriate translation to a central database
- another approach is to implement a middleware, whose function is to support an integrated model of the data of the various databased, while translating between this model and the actual models used by each database
7
Q
Sources of commands to the DBMS
A
- Conventional users and application programs that ask or data or modify data
- Database administrator: person responsible for the structure or schema of the database
8
Q
Schema Altering Commands
A
- schema-altering data-definition language (DDL) commands are parsed by a DDL processor and passed to the execution engine which then goes through the index/file/record manager to alter the metadata (schema information for the database)
9
Q
Answering a Query
A
- query is parsed and optimized by a query compiler
- resulting query plan or sequence of actions the DBMS will perform to answer the query, is passed to the execution engine
- execution engine requests for small pieces of data, typically records or tuples of a relation to a resource manager that know about data files, the format, and size of the records, index files (which help find elements of data files quickly)
- request for data passed to buffer manager: brings data from secondary storage to the main memory buffers
- buffer manager communicates with a storage manager to get data from the disk
- query compiler->execution engine->resource manager->buffer manager->storage manager
10
Q
Transaction Processing
A
- query and other DML actions are grouped into transactions (units that must be executed atomically and in isolation from one another)
- execution of transactions must be durable, meaning that the effect of any completed transaction must be preserved even if the system fails in some way right after completion of the transaction
11
Q
Transaction Processor
A
- Concurrency-control manager, or scheduler: responsible for assuring atomicity and isolation of transactions
- Logging and recovery manager, responsible for the durability of transactions
12
Q
Storage and Buffer Management
A
- data of database resides in secondary storage, however, to perform operations on data, it must be in the main memory
- storage manager controls the placement of data on disk and movement between disk and main memory
- storage manager keeps track of the location of files on the disk and obtains the blocks containing a file on request from the buffer manager
- buffer manager: responsible for the partitioning the available main memory into buffers, or page-sized regions into which disk blocks can be transferred
13
Q
Types of information
A
- Data: contents of the database itself
- Metadata: database schema that describes the structure of, and constraints on the database
- Log Records: information about recent changes to the database; these support durability of the database
- Statistics: information gathered and stored by the DBMS about data properties such as the size of, and values in, various relations and other components of the database
- Indexes: data structures that support efficient access to the data
14
Q
Transaction manager
A
- accepts transaction commands from an application, which will tell the transaction manager when transactions begin and end, as well as information about the expectations of the application (some many not wish to require atomicity)
15
Q
Transaction Processor Tasks
A
- Logging: assure durability, every change in the database is logged separately on the disk
- log manager assure that when a system fails or crash, the recovery manager will be able to examine the log of changes and restore the database to some consistent state
- 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) - Concurrency control: transactions must appear to execute in isolation
- scheduler maintains locks on certain pieces of the database
- locks prevent two transactions from accessing the same piece of data in ways that interact badly
- locks are stored in the main memory lock table
- scheduler affects the execution of queries and other database operations by forbidding the execution engine from accessing lock parts of the database - Deadlock resolution: transaction manager has the responsibility to intervene and cancel one or more transactions to let the others proceed