7.8 Granular Locks

Phantoms raise the issue of defining the lock unit, the data aggregates that are locked to insure isolation. Candidate units are databases, files, file subsets, records, fields within records, and so on. The choice of lock granule presents a trade-off between concurrency and overhead. On the one hand, concurrency is maximized by a fine locking granule (such as a record). Record locking is good for many small transactions running in parallel. On the other hand, a small locking granule is costly for a complex transaction that accesses a large number of granules. The large transaction would have to acquire and maintain a lock on each granule. A coarse locking granule, such as a file, is convenient for complex transactions. ...

Get Transaction Processing now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.