Many Faces of Ad Hoc Transactions
Transactions are the fundamental database abstraction for ensuring application correctness under concurrency and failures. Using database transactions, developers are only tasked with demarcating critical business logic into transactions, and the underlying database system is responsible for coordinating their execution. Yet, in today's Web applications, transactions are often constructed in an ad hoc manner. That is, developers might explicitly use locking primitives or manual validation to coordinate critical code fragments, instead of relying on database transactions. We refer to such application-coordinated transactions as ad hoc transactions . This paper presents the first comprehensive study on ad hoc transactions. Examining 91 ad hoc transaction instances taken from eight popular open-source Web applications, we find that (i) every application studied uses ad hoc transactions (up to 16 per application), 71 of which play critical roles; (ii) compared with database transactions, coordination strategies 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, this paper concludes with a discussion about the implications of ad hoc transactions and opportunities for future research.
Authors
- Chuzhe Tang (ORCID: https://orcid.org/0000-0001-7757-5708)
- Binyu Zang (ORCID: https://orcid.org/0000-0002-1968-7645)
- Qianmian Yu (ORCID: https://orcid.org/0009-0004-1834-8942)
- Haibing Guan (ORCID: https://orcid.org/0000-0002-4714-7400)
- Xiaodong Zhang (ORCID: https://orcid.org/0000-0002-8288-035X)
- Haibo Chen (ORCID: https://orcid.org/0000-0002-9720-0361)
- Zhaoguo Wang (ORCID: https://orcid.org/0000-0002-0220-5726)
Institutions
- Shanghai Jiao Tong University (CN)
Publication Details
- Journal
- Communications of the ACM
- Published
- 2025-03-17
- DOI
- https://doi.org/10.1145/3708552
- Primary Topic
- Distributed systems and fault tolerance
- Type
- article
- Field-Weighted Citation Impact
- 0.00