Chapter 19 Transactions
Objectives
To establish the ACID properties of transactions. To establish a conceptual framework (an object model and serialisability theory) as a basis for studying how these properties can be maintained under concurrent execution and crashes.
Points to emphasise
- Consistency (C) and Isolation (I) are the concerns of concurrency control (Ch 20). Atomicity (A) and Durability (D) are the concerns of crash resilience (Ch 21). We shall focus on C and I until we reach Chapter 21.
- C and I are maintained by a serial execution of transactions; that is, by implementing each transaction as a single atomic operation. We have argued (Ch 16) that we need more concurrency than this.
- C is maintained by a serialisable execution of transactions. Section
19.6.1 defines conflicting operations in the context of an object model and
19.6.2 gives a definition of serialisability in terms of conflicting operations.
- An execution schedule for the operations of a number of transactions can be represented as a directed graph. This is called a history. We require a transaction history to be serialisable.
- A serialisation graph is derived from a history and shows only transactions rather than the operations of transactions. We prove (in 17.8) that a transaction history is serialisable if and only if its serialisation graph is acyclic.
- The behaviour of the system must be as though the property of Isolation was enforced in the implementation of transactions. If we optimistically relax this property to achieve higher concurrency we have to be able to recover when things go wrong.
- We are not attempting to cover nested transactions explicitly.
Possible difficulties
The material in this chapter is fundamental and conceptually difficult. Chapters 20, 21 and 22 rely on these concepts.
Teaching hints
- Recall concurrency control (done in Part II) for Chapter 15s single atomic operation. We now have composite operations with each component guaranteed atomic with respect to concurrent execution. What are the new problems?
- Reinforce the idea of conflicting operations. Ask the students for examples.
- Give as much time as possible to this material. The students should spend private study time on it. Make sure they know the definition of serialisability (19.6.2) and that a transaction history is serialisable if its serialisation graph is acyclic (19.8).
- Isolation may or may not be enforced in the implementation. Define a strict execution. What are the trade-offs? Discuss optimistic-Vs-pessimistic assumptions. Relate the discussion to different application areas.