skip to main content
article

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

Published: 08 June 2023 Publication History

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.
[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.
[3]
M. Dashti, S. Basil John, A. Shaikhha, and C. Koch. Transaction repair for multi-version concurrency control. In SIGMOD '17.
[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.
[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.
[6]
H. Garcia-Molina and K. Salem. Sagas. SIGMOD Rec., 16(3):249--259, Dec. 1987.
[7]
J. R. Jordan, J. Banerjee, and R. B. Batman. Precision locks. In SIGMOD '81.
[8]
H. T. Kung and J. T. Robinson. On optimistic methods for concurrency control. ACM Trans. Database Syst., 6(2):213--226, June 1981.
[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.
[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.
[11]
T. Neumann, T. M¨uhlbauer, and A. Kemper. Fast serializable multi-version concurrency control for main-memory database systems. In SIGMOD '15.
[12]
C. Pu, G. E. Kaiser, and N. C. Hutchinson. Split-transactions for open-ended activities. In VLDB '88.
[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.
[14]
S. Tu, W. Zheng, E. Kohler, B. Liskov, and S. Madden. Speedy transactions in multicore in-memory databases. In SOSP '13.
[15]
T. Warszawski and P. Bailis. ACIDRain: Concurrency-related attacks on database-backed web applications. In SIGMOD '17.
[16]
Y. Wu, C.-Y. Chan, and K.-L. Tan. Transaction healing: Scaling optimistic concurrency control on multicores. In SIGMOD '16.
[17]
W. Xiong, S. Park, J. Zhang, Y. Zhou, and Z. Ma. Ad hoc synchronization considered harmful. In OSDI '10.

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM SIGMOD Record
ACM SIGMOD Record  Volume 52, Issue 1
March 2023
118 pages
ISSN:0163-5808
DOI:10.1145/3604437
Issue’s Table of Contents
Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for third-party components of this work must be honored. For all other uses, contact the Owner/Author.

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 08 June 2023
Published in SIGMOD Volume 52, Issue 1

Check for updates

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 150
    Total Downloads
  • Downloads (Last 12 months)78
  • Downloads (Last 6 weeks)4
Reflects downloads up to 15 Feb 2025

Other Metrics

Citations

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media