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. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access