You are on page 1of 2

1. What is Transaction?

- a unit of work (collection of database operations) that should be processed reliably . It


Supports daily operations of an organization. DBMSs provide recovery and concurrency
control services to process transactions efficiently and reliably so that there is no loss of
data due to multiple users and system failures

2. Give 2 examples of transaction in daily life.

a. Airline transaction
b. ATM transaction

3. What are elements of transaction properties. Give your explanation for each element.

a. Atomic : either all the work in the transaction is completed or nothing is done
b. Consistent: database must be consistent before and after a transaction
c. Isolated: no unwanted interference from other users. A transaction should never
overwrite changes made by another transaction
d. Durable: database changes are permanent after the transaction completes

4. Explain types of transaction processing services.

a. Concurrency transparency : users perceive the database as a single-user system even


though there may be many simultaneous users
b. Recovery transparency: DBMS automatically restores a database to a consistent state
after a failure

Service characteristics
o Transparent: inner details of transaction services are invisible
o Consume significant resources eg memory, disk space to improve performance
o Significant cost component: DBMSs that support large numbers of concurrent
users can be costly
o Transaction design is important: poor design can lead to performance problems

5. What is the purpose of having concurrency control?

- Maximize transaction throughput (work perform) while preventing interference among


multiple users
- Throughput: number of transactions processed per unit time eg >1million transaction
per second

6. Explain and give 3 examples of concurrency control problem.

1. Lost Update Problem


- A concurrency control problem in which a data update is lost during the concurrent
execution of transactions
2. Uncommitted Dependency Problem
- A concurrency control problem in which a transaction accesses uncommitted data from
Another transaction
3. Inconsistent Retrieval Problems
- A concurrency control problem that arises when a transaction calculating summary
(aggregate) functions over a set of data while other transactions are updating the data,
yielding erroneous results.

7. What are the problem for inconsistent retrieval?

1. Incorrect Summary Problem


2. Phantom Read Problem
3. Nonrepeatable Read Problem

8. Explain 3 examples of concurrency control techniques.

1. Locking method
a. Lock Granularity
b. Lock types
c. Two-Phase locking to ensure serializability
d. Deadlocks
2. Time stamping method
a. Wait/Die and Wound/Wait Schemes
3. Optimistic method
a. Read phase, Validation phase and Write phase

9. What is lock granularity?

- The size of the database item locked


- A trade-off between waiting time (amount of concurrency permitted) and overhead
(number of locks held)

10. How locking works as a concurrency control?

- Locking method are one of the most common techniques used in concurrency control
because they facilitate the isolation of data items used in concurrently executing
transactions. A lock guarantees exclusive use of a data item to a current transaction.
In other words, transaction T2 does not have access to a data item that is currently
being used by transaction T1. A transaction acquires a lock prior to data access, the
lock is released(unlocked) when the transaction is completed so that another
transaction can lock the data item for its exclusive use. This series of locking actions
assumes that concurrent transactions might attempt to manipulate the same data
item at the same time. The use of locks based on the assumption that conflict
between transactions is likely is usually referred to as pessimistic locking.

You might also like