skip to main content
article

Ad Hoc Transactions: What They Are and Why We Should Care

Authors Info & Claims
Published:08 June 2023Publication History
Skip Abstract Section

Abstract

Many transactions in web applications are constructed ad hoc in the application code. For example, developers might explicitly use locking primitives or validation procedures to coordinate critical code fragments. We refer to database operations coordinated by application code as ad hoc transactions. Until now, little is known about them. This paper presents the first comprehensive study on ad hoc transactions. By studying 91 ad hoc transactions among 8 popular open-source web applications, we find that (i) every studied application uses ad hoc transactions (up to 16 per application), 71 of which play critical roles; (ii) compared with database transactions, concurrency control of ad hoc transactions is much more flexible; (iii) ad hoc transactions are error-prone-53 of them have correctness issues, and 33 of them are confirmed by developers; and (iv) ad hoc transactions have the potential to improve performance in contentious workloads by utilizing application semantics such as access patterns. Finally, implications of ad hoc transactions to the database research community are discussed.

References

  1. P. Bailis, A. Fekete, M. J. Franklin, A. Ghodsi, J. M. Hellerstein, and I. Stoica. Feral concurrency control: An empirical investigation of modern application integrity. In SIGMOD '15.Google ScholarGoogle Scholar
  2. P. Bailis, A. Fekete, M. J. Franklin, A. Ghodsi, J. M. Hellerstein, and I. Stoica. Coordination avoidance in database systems. Proc. VLDB Endow., 8(3):185--196, Nov. 2014.Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. M. Dashti, S. Basil John, A. Shaikhha, and C. Koch. Transaction repair for multi-version concurrency control. In SIGMOD '17.Google ScholarGoogle Scholar
  4. Z. Dong, C. Tang, J. Wang, Z. Wang, H. Chen, and B. Zang. Optimistic transaction processing in deterministic database. Journal of Computer Science and Technology, 35(2):382--394, Mar. 2020.Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. K. P. Eswaran, J. N. Gray, R. A. Lorie, and I. L. Traiger. The notions of consistency and predicate locks in a database system. Commun. ACM, 19(11):624--633, Nov. 1976.Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. H. Garcia-Molina and K. Salem. Sagas. SIGMOD Rec., 16(3):249--259, Dec. 1987.Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. J. R. Jordan, J. Banerjee, and R. B. Batman. Precision locks. In SIGMOD '81.Google ScholarGoogle Scholar
  8. H. T. Kung and J. T. Robinson. On optimistic methods for concurrency control. ACM Trans. Database Syst., 6(2):213--226, June 1981.Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. C. Li, J. Leitao, A. Clement, N. M. Pregui¸ca, R. Rodrigues, and V. Vafeiadis. Automating the choice of consistency levels in replicated systems. In USENIX ATC '14.Google ScholarGoogle Scholar
  10. C. Li, D. Porto, A. Clement, J. Gehrke, N. Pregui¸ca, and R. Rodrigues. Making geo-replicated systems fast as possible, consistent when necessary. In OSDI '12.Google ScholarGoogle Scholar
  11. T. Neumann, T. M¨uhlbauer, and A. Kemper. Fast serializable multi-version concurrency control for main-memory database systems. In SIGMOD '15.Google ScholarGoogle Scholar
  12. C. Pu, G. E. Kaiser, and N. C. Hutchinson. Split-transactions for open-ended activities. In VLDB '88.Google ScholarGoogle Scholar
  13. C. Tang, Z. Wang, X. Zhang, Q. Yu, B. Zang, H. Guan, and H. Chen. Ad hoc transactions in web applications: The good, the bad, and the ugly. In SIGMOD '22.Google ScholarGoogle Scholar
  14. S. Tu, W. Zheng, E. Kohler, B. Liskov, and S. Madden. Speedy transactions in multicore in-memory databases. In SOSP '13.Google ScholarGoogle Scholar
  15. T. Warszawski and P. Bailis. ACIDRain: Concurrency-related attacks on database-backed web applications. In SIGMOD '17.Google ScholarGoogle Scholar
  16. Y. Wu, C.-Y. Chan, and K.-L. Tan. Transaction healing: Scaling optimistic concurrency control on multicores. In SIGMOD '16.Google ScholarGoogle Scholar
  17. W. Xiong, S. Park, J. Zhang, Y. Zhou, and Z. Ma. Ad hoc synchronization considered harmful. In OSDI '10.Google ScholarGoogle Scholar

Recommendations

Comments

Login options

Check if you have access through your login credentials or your institution to get full access on this article.

Sign in

Full Access

  • Article Metrics

    • Downloads (Last 12 months)93
    • Downloads (Last 6 weeks)8

    Other Metrics

PDF Format

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader