Modern applications, such as social networking systems and e-commerce platforms are centered around using large-scale storage systems for storing and retrieving data. In the presence of concurrent accesses, these storage systems trade off isolation for performance. The weaker the isolation level, the more behaviors a storage system is allowed to exhibit and it is up to the developer to ensure that their application can tolerate those behaviors. However, these weak behaviors only occur rarely in practice, that too outside the control of the application, making it difficult for developers to test the robustness of their code against weak isolation levels. This paper presents MonkeyDB, a mock storage system for testing storage-backed applications. MonkeyDB supports a Key-Value interface as well as SQL queries under multiple isolation levels. It uses a logical specification of the isolation level to compute, on a read operation, the set of all possible return values. MonkeyDB then returns a value randomly from this set. We show that MonkeyDB provides good coverage of weak behaviors, which is complete in the limit. We test a variety of applications for assertions that fail only under weak isolation. MonkeyDB is able to break each of those assertions in a small number of attempts.
翻译:社交网络系统和电子商务平台等现代应用中心是使用大型存储系统储存和检索数据。 在同时存取的情况下,这些存储系统可以互换单独的性能。 较弱的隔离级别, 存储系统可以展示的行为越多, 由开发者来确保其应用能够容忍这些行为。 然而, 这些薄弱的行为只在实践上很少发生, 并且超出了应用程序的控制范围, 使得开发者很难测试其代码的稳健性, 以适应薄弱的隔离级别。 本文展示了MonkeyDB, 一个测试存储备份应用程序的模拟存储系统。 MonkeyDB 支持一个关键Value界面, 以及在多个隔离级别下 SQL 查询。 它使用对隔离等级的逻辑性规格来计算, 在阅读操作中, 所有可能的返回值的集。 猴子DB 然后随机地从这个组合中返回一个值 。 我们显示, MonkeyDB 提供了对薄弱行为的良好覆盖范围, 这是在极限范围内的。 我们测试了各种用于证明失败的应用程序。 我们测试了在较弱的孤立状态下, 猴子DB 能够打破每一个声明的尝试。