CS262A Reading Summary 2

Transaction Models (excerpt from Gray and Reuter's Transaction Processing: Concepts and Techniques)

Feng Zhou
9/5/2002

This part of the book first describes the nature of atomic actions. After that the classic definition and properties of flat transaction are discussed. Finally limitations and some modifications to the classic transaction model are presented. Main points in the text include,

  1. Transactions are used to provide general-purpose ACID support. Atomic operations sometimes come for free, sometimes are very hard/impossible to achieve.
  2. Atomicity includes two aspects of meaning: a) when and how the results of the operation are made accessible to other operations; b) How can unsuccessful operation be rolled back without side effects.
  3. Single disk writes are often seen as atomic, but they are not. To make it appears atomic, we have several ways: read-after-write, duplexed write and logged write.
  4. Actions can be categorized into 3 groups: a) unprotected actions are not atomic. They must be controlled by application environment or protected within a protected action to make the whole operation atomic; b) protected actions are building blocks of reliable applications; c) real actions can not be "rolled-back". So they need special treatment.
  5. Flat transaction is the classic but still most popular model for transactions. It has the ACID properties. They are called flat because there is only one layer of control.
  6. There are scenarios where flat transactions are awkward. Examples are complex updates and bulk updates. The former can be supported by savepoints or by nested transactions. The latter can be supported by chained transactions or sagas.

One question about the text:

The part about atomic actions put a lot of words on the issue of disk writes. It says that the controller may return normally without data being written correctly, and proposes to use "read-after-write" to solve the problem. However, a lot of checks are done by the disk hardware. So the probability that this kind of error would happen compared to the price you pay with "read-after-write" is so tiny. I don't see when this will be useful.

Principles of Transaction-Oriented Database Recovery

Theo Haerder and Adreas Reuter

This paper describes a taxonomy for classifying implementation techniques for database recovery.  By using only 4 criteria (3 of them are binary), most implementations can be categorized and analyzed.  The paper discussed pros and cons of  some combination of the four criteria and existing implementations.  Thus the authors successfuly consolidates all kinds of algorithms and techniques used in database recovery and present a clear overview of the literature.

First two parts of the paper include these enlightening points:
One major flaw.
The author seemed to think ATOMIC is naturally more elegant than and could finally replace ¬ATOMIC, which was then widely used in commercial DB products.  "Shadow page" in System R is among the ATOMIC side, which turned out to be a bad idea.  To my knowledge most DBMSes now use ¬ATOMIC.  This again proves that there are cases where simpler and more "brute-force" methods can be more effective than more elegant and sophisticated ones.