Why can't you use a single ACID transaction across multiple microservices?
A single ACID transaction requires one coordinator holding locks and a shared commit protocol across every participating resource, which in practice means a shared database, or at least a tightly coupled distributed-transaction protocol like two-phase commit. Independent microservices deliberately don't share a database — that's the entire point of splitting them — so there's no single transactional context spanning all of them. Even where a two-phase-commit-style protocol is technically possible, it requires every participating service to hold locks and stay available for the duration of the transaction, which directly undermines the independent availability and scalability microservices are meant to provide. The saga pattern exists specifically to get consistency across these independent services without requiring that shared transactional context at all.
Ready to master this question?
Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.
Sign in to generate a response