Exploiting Hardware Transactional Memory for Efficient In-Memory Transaction Processing

Hao Qian,Zhaoguo Wang,Haibing Guan,Binyu Zang,Haibo Chen
2015-01-01
Abstract:The commercial availability of Intel’s Haswell processor suggests that hardware transactional memory (HTM), a technique inspired by database transactions, is likely to be widely exploited for in-memory databases in the near future. Its features such as hardware-maintained read/write sets and automatic conflict detection naturally put forward a challenge on how HTM can successfully support concurrency control for fast in-memory transaction processing. To answer this challenge, we first conduct a detailed analysis on solely using HTM to protect a database transaction without other concurrency controls such as OCC or 2PL. Our analysis reveals that such an approach may lead to scalability issues due to the high probability of aborting transactions. To reduce HTM-protected transaction regions, we propose to leverage the theory of transaction chopping with several workload-inspired optimizations, including recovering commutativity with deferred execution and a database cache for database operations, to reduce HTM aborts while preserving serializability. While transaction chopping effectively reduces HTM aborts due to memory access conflicts, it also creates a new challenge for read-only transactions, which can no longer observe a consistent database snapshot. To address this problem, we propose a lazy snapshot mechanism that constructs a database snapshot during execution which eventually becomes consistent. We implement the proposed techniques in DBX-TC on an Intel Haswell processor and conduct an extensive performance study. Performance evaluation shows that DBX-TC with our mechanisms outperforms a naively constructed database using HTM by 4.77x and 36% over DBX on a 4-core/8threads machine. The speedup is especially significant under high contention.
What problem does this paper attempt to address?