5 Transactions
This chapter covers
- The concept of abstractions
- The concept of transactions
- The significance of transactions
- The implementation of transactions
Transactions—the most popular, most powerful abstractions in the history of software engineering—are rooted in the world of database systems, not in the world of distributed systems. So, why are we covering transactions in this book? Transactions were swiftly and broadly adopted in the context of distributed systems and are recognized as the benchmark for an exceptional developer experience.
Transactions provide certainty in an uncertain world: Transactions allow you to pretend that concurrency or failure does not even exist!
Transactions now stand as some of the most ubiquitous abstractions in the field of software engineering. Almost every software engineer knows of transactions and their fundamental principles encapsulated by ACID—Atomicity, Consistency, Isolation, and Durability.
Most authors introduce and explain transactions in terms of ACID guarantees. However, ACID presents the properties of transactions as separate, independent concepts. In chapter 1, we emphasized the value of exploring different mental models and adopting alternative thinking approaches to gain a holistic understanding of a topic. Building upon that notion, we will introduce and explain transactions from a different perspective, not through the lens of ACID guarantees, but rather through the lens of correctness and completeness guarantees.