Concurrency Control Based on Transaction Clustering
Xuebin Su, Hongzhi Wang, Yan Zhang · 2021
Concurrency control is a mechanism that database systems provide to allow multiple transactions to be executed at the same time while enforcing isolation. The concurrency control algorithm is key to performance of a database system. However, different concurrency control algorithms have different strengths and weaknesses, making each of them fits only for some types of workloads, while performs unsatisfactorily for others. As a result, the user will have to make assumptions about the workloads before choosing the concurrency control algorithm to achieve the best performance. To overcome this limitation, we propose a scheme, called transaction clustering, to decide the best isolation mechanism for any given pair of transactions automatically. Based on transaction clustering, we further develop the Clustering-based Concurrency Control algorithm, or C3 for short, which combines the pessimistic and the optimistic concurrency control algorithms to get the best of both worlds while mitigating their performance bottlenecks at the same time. Both theoretical and experimental studies show that, for high-conflict workloads, the performance of the C3 algorithm can be significantly better than the performance of both the pessimistic and the optimistic algorithms that C3 is based on.