The support for transactions is an essential part of a database management system (DBMS). Without this support, the developers are burdened with ensuring atomic execution of a transaction despite failures as well as concurrent accesses to the database by other transactions. Ideally, a transactional system provides serializability, which means that the outcome of concurrent transactions is equivalent to a serial execution of them. Based on experiences on lock-based implementations, nevertheless, serializability is known as an expensive feature that comes with high overhead and low concurrency. Commercial systems, hence, compromise serializability by implementing weaker guarantees such as snapshot isolation. The developers, therefore, are still burdened with the anomalies that could arise due to the lack of serializability. There have been recent attempts to enrich large-scale data stores, such as HBase and BigTable, with transactional support. Not surprisingly, inspired by traditional database management systems, serializability is usually compromised for the benefit of efficiency. For example, Google Percolator, implements lock-based snapshot isolation on top of BigTable. We show in this paper that this compromise is not necessary in lock-free implementations of transactional support. We introduce write-snapshot isolation, a novel isolation level that has a performance comparable with that of snapshot isolation, and yet provides serializability. The main insight in write-snapshot isolation is to prevent read-write conflicts in contrast to write-write conflicts that are prevented by snapshot isolation.
翻译:事务支持是数据库管理系统(DBMS)不可或缺的组成部分。若缺乏此支持,开发者将不得不承担确保事务原子性执行的负担,以应对系统故障及其他并发事务对数据库的访问。理想情况下,事务系统应提供可串行化保障,即并发事务的执行结果等效于它们的某种串行执行序列。然而,基于锁实现方案的经验表明,可串行化通常被视为代价高昂的特性,伴随高开销与低并发性。因此,商业系统常通过实现弱一致性保证(如快照隔离)来折衷可串行化要求。这导致开发者仍需处理因缺乏可串行化而可能引发的数据异常现象。近年来,已有研究尝试为HBase、BigTable等大规模数据存储系统增强事务支持能力。受传统数据库管理系统影响,这些系统通常为提升效率而牺牲可串行化保障。例如,Google Percolator即在BigTable之上实现了基于锁的快照隔离机制。本文论证了在无锁事务支持实现中,这种折衷并非必要。我们提出写快照隔离这一新型隔离级别,其性能与快照隔离相当,同时能提供可串行化保证。写快照隔离的核心思想在于预防读写冲突(而快照隔离主要预防写写冲突),这一根本差异使其在保持高性能的同时实现了可串行化。