Serializability is a well-understood concurrency control mechanism that eases reasoning about highly-concurrent database programs. Unfortunately, enforcing serializability has a high-performance cost, especially on geographically distributed database clusters. Consequently, many databases allow programmers to choose when a transaction must be executed under serializability, with the expectation that transactions would only be so marked when necessary to avoid serious concurrency bugs. However, this is a significant burden to impose on developers, requiring them to (a) reason about subtle concurrent interactions among potentially interfering transactions, (b) determine when such interactions would violate desired invariants, and (c) then identify the minimum number of transactions whose executions should be serialized to prevent these violations. To mitigate this burden, in this paper we present a sound and fully automated schema refactoring procedure that transforms a program's data layout -- rather than its concurrency control logic -- to eliminate statically identified concurrency bugs, allowing more transactions to be safely executed under weaker and more performant database guarantees. Experimental results over a range of database benchmarks indicate that our approach is highly effective in eliminating concurrency bugs, with safe refactored programs showing an average of 120% higher throughput and 45% lower latency compared to the baselines.
翻译:串联性是一个广为人知的共通货币控制机制,可以方便对高度波动的数据库程序进行推理。 不幸的是,执行连连锁性具有很高的性能成本,特别是在地理分布的数据库群中。 因此,许多数据库允许程序员选择何时必须按连载性进行交易,期望交易只有在为了避免严重汇兑错误而有必要时才会如此标记。然而,这对开发者来说是一个沉重的负担,要求他们:(a) 潜在干扰性交易之间微妙同时相互作用的原因,(b) 确定这种相互作用何时会违反预期的变异性,以及(c) 然后确定执行交易的最小数量,这些交易应分期进行,以防止这些违规行为。为了减轻这一负担,我们在本文件中提出了一个健全和完全自动化的重组程序,以改变程序的数据布局 -- -- 而不是其同价控制逻辑 -- -- 以静态方式识别的同通货币错误,从而允许在较弱和业绩更强的数据库保证下安全地进行更多的交易。 一系列数据库基准的实验结果表明,我们的方法在消除同值错误方面非常有效,比标准比的更低比例为120。