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 the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.