Chapter 1 Flashcards
1
Q
What is a DBMS
A
- A very large, integrated collection of data.
- Is a software package designed to store and manage data
2
Q
What is the primary goal of the DBMS?
A
- Provide convenient and efficient environment for storing and retrieving DB information.
3
Q
Why would you use a DBMS?
A
- Data independence
- Efficient access
- Data integrity and security
- Concurrent access, recovery from crashes
4
Q
Why would you not want to use a DBMS?
A
- It can be expensive, may have special performance requirements
5
Q
What are data models?
A
- It is a collection of concepts for describing data.
- Think of it like an object in programming. A student model has things such as name, address etc. attached to it.
6
Q
What is a database schema?
A
- It is a description of a particular collection of data
- Think of it like an application, it uses a bunch of data models.
7
Q
What is a view?
A
- It defines how a user will see a certain set of data. Sometimes we want to store sensitive information but allow only a very restricted set of users to see it. That is where views come in.
8
Q
What is concurrency control?
A
- It allows multiple requests/queries to come into the database at the same time.
- The database must manage the different actions to make sure nothing is corrupted.
9
Q
What is a transaction?
A
- It is an atomic sequence of events. Each of these events must leave the database in a consistent state. If there are multiple transactions occurring at the same time, the database will schedule them in some order. If two transactions will work on the same entry, then the first transaction will obtain a lock on the entry so that the second transaction will have to wait for the first one to finish.
10
Q
How are crashes managed if a crash occurs mid-transaction?
A
- When a transaction gets executed, the database keeps a log of all the actions it takes. If a crash occurs mid-transaction, then all of those changes are rolled back.
- Saving the logs is done using the ‘Write Ahead Log’ (WAL) protocol.
11
Q
What actions are recorded in the transaction log?
A
- Who performed the transaction
- When an entry is updated, the old value and the new value get saved. The old value gets updated with the new value after it is saved in the log.
- The log commit/abort.
- Logs are chained by transaction ID so it is very easy to roll back a change.