Introduction, Transactions, Concurrency Control and Recovery Flashcards

1
Q

What are database transactions

A

query
update
transaction

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

What is a query?

A

a query is a request to the DBMS to retrieve data from the database

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

What is a update?

A

an update requests the DBMS to insert, delete or modify existing data

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

What is a transaction?

A

a transaction is a unit of work performed against a database, and treated in a coherent and reliable way independent of other transactions.

transactions are logical groupings of query and update requests to perform a task

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

Transactions management only applies to the DML. why?

A

this encompasses the four basic functions of persistent storage, create, read, update and delete (CRUD)

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

FACTS about transactions

A

each SQL command run is treated as a transaction

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

How do you define a multi step transaction

A

START TRANSACTION or BEGIN starts a new transaction

COMMIT to commit (Save) the current transaction making its changes permanent

usually used to ensure;
complex data integrity

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

transaction states are?

A

two outcomes;
SUCCESS
FAILURE

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

Describe Failure

A

transaction aborts, and database must be resorted to consistent state before it started. such a transaction is rolled back or undone.

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

Describe Success

A

transaction commits and database reaches a new consistent state

a committed transaction cannot be ABORTED!

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

Transaction managers are components of a DBMS.

describe the two main purposes.

A
  1. to provide reliable units of work

2. to provide isolation between programs accessing a database concurrently.

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

to ensure these goals, DB transactions must be:

A

atomic
consistent
isolated
durable

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

Explain atomicity

A

either all the operations associated with a transaction happen or none of them happen

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

Explain consistency

A

a transaction must transform the database from one consistent state to another, ensuring all predefined rules are adhered to

e.g. foreign keys

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

Explain Isolation

A

the result of the execution of concurrent

transactions is the same as if transactions were executed serially

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

Explain Durability

A

the effects of completed transactions become permanent surviving any subsequent failures

17
Q

Why is transaction manager necessary/

A

Concurrency

Failure Tolerance

18
Q

what is concurrency?

A

we want to allow multiple OPERATIONS to be performed at the SAME TIME so as to increase db THROUGHPUT

support by multi-threading, multi-processors

19
Q

What is failure tolerance

A

we want the DB to be resilient from system crashes due to hardware or software failures

20
Q

What would happen if DBMS has poor transaction management…?

A

lost updates
uncommitted dependencies
inconsistent analysis

21
Q

Lost updates are?

A

an apparently successful completed

update by one user can be overridden by another user

22
Q

what are uncommitted dependencies?

A

one transaction is allowed to see intermediate results of another transaction
before it has committed

23
Q

what are inconsistent analysis?

A

a transaction reads several values from the DB but a second transaction updates
some of them during the execution of the first

24
Q

A solution to these issues transactions are SERIAL schedules. explain what this is

A

allows only one transaction to execute at at time

25
Q

what is a non-serial schedule?

A

is where the operations from a set of concurrent transactions are interleaved

26
Q

what is serialisability?

A

if a set of transactions execute concurrently, we say that the non-serial schedule is correct if it produces the same results as some serial execution (this schedule is called serialisable)

27
Q

how to recover schedules?

A

for each pair of transactions Ta, and TB, if Tb reads a data item previously written by Ta, then the commit operation of Ta, must precede the commit operation of Tb

28
Q

What are concurrency control schemes?

A

a trade-off between the amount of concurrency they allow and the amount of overhead that they incur

29
Q

what is a concurrency control

A

is the process of managing simultaneous operations on the DB without having them interfere with one another