Multiple Granularity, Multi version Scheme
Multiple granularity and multi-version schemes are two related concepts in concurrency control.
Multiple granularity refers to the ability to control concurrency at different levels of granularity. In a database system, the levels of granularity could be the entire database, a single table, a page within a table, or even a single data item within a page. Multiple granularity allows for more fine-grained control over concurrency and can improve performance by reducing the number of locks held.
Multi-versioning is a concurrency control technique that maintains multiple versions of a data item to allow for multiple transactions to access the data simultaneously. Each version of the data item is timestamped and represents a different point in time at which the data was valid. When a transaction wants to read a data item, it is given the version of the data that was valid at the time of the transaction’s start timestamp. When a transaction wants to write a data item, it creates a new version of the data and updates the timestamp.
A multi-version, multiple granularity scheme combines these two concepts to provide even more fine-grained control over concurrency. In this scheme, different levels of granularity can use different concurrency control techniques, such as multi-versioning or locking. For example, a database system might use multi-versioning for fine-grained control over individual data items, while using locking at the page level or higher to reduce overhead.
Overall, a multi-version, multiple granularity scheme can provide better performance and concurrency control than simpler schemes that rely on a single technique, such as locking or multi-versioning alone. However, implementing such a scheme can be complex and requires careful management to ensure that transactions are properly coordinated and conflicts are resolved.