Concurrency Flashcards

1
Q

What is a transaction?

A

Transaction: a logical unit of database processing that includes one or more access operations (read/retrieval, write/update, delete).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the lost update problem?

A

If two transactions are running at the same time and access same variable X, If T1 updates X but T2 reads it before T1 writes update then T1’s update is lost.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the Temporary Update problem?

A

A transaction working with uncommited changes

If T1 crashes and needs to be rolled back, T2 has made a dirty read and cannot be rolled back.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the Unrepeatable Read problem?

A

This happens when a transaction reads two different values for a single variable in the same transaction.

T2 modified it and commited before first and second read in T1.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the Incorrect Summary Problem?

A

When a transaction is performing an aggregate function on a set of values and another transaction is making alterations to those values at the same time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the Phantom Read problem?

A

A phantom read is similar to both an
incorrect summary and an unrepeatable
read.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a commit point in terms of recovery

A

A transaction reaches its commit point if:
○ It finishes successfully
○ All effects are recorded in the log.

It is then considered permanantly stored in the DB.

Entry is recorded in the log.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is stored in system log?

A

start_transaction, T

write_item, T, X, old_value, new_value

read_item, T, X

commit, T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Describe serializability

A

Serializability is the classical concurrency scheme.

It ensures that a schedule for executing concurrent transactions is equivalent to one that executes the transactions serially in some order.

➢ A serial schedule is a schedule such that there is no interleaving of the operations of the transactions.

➢ If a schedule is serial we can guarantee that no lost updates, incorrect summary problems etc, will arise.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Describe Conflict serializablity

A

We say that there is a conflict between two transactions T1 and T2 if they contain operations that conflict with each other.

A schedule S is said to be conflict serializable if the conflicting operations occur in exactly the same order as some serial schedule.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly