14.3.2: New Consistency Models and Distributed Transaction Techniques

Introduction to Cloud Computing · LibreTexts

0%

Contents

    Text

    Size
    100%
    Theme
    Typeface
    Line length
    Spacing

    Read aloud

    How

    Speed: 1×
    Light up
    Highlight

    Symbols: Mulberry Symbols, © 2018–2026 Steve Lee, CC BY-SA 4.0 (licence, the set), the site's own copies.

    From LibreTexts, under CC BY 4.0, as the source states it; its equations are written in TeX, which the PDF shows typeset. This page at LibreTexts.

    14.3.2: New Consistency Models and Distributed Transaction Techniques

    Beyond CRDTs and event sourcing, the future will bring other innovations in maintaining consistency:

    • Global ACID via New Algorithms: Some systems still require strong consistency (e.g., banking transactions). Instead of traditional two-phase commit (2PC), which can block in failures, new algorithms have emerged. Google Spanner famously introduced TrueTime – leveraging synchronized atomic clocks to achieve external consistency (serializability across datacenters). FaunaDB uses a Calvin protocol (deterministic ordering of transactions) to avoid distributed locks. These approaches show that globally consistent transactions at scale are possible – Spanner provides full SQL and ACID across continents, though with careful trade-offs (latency of ~10 ms added due to waiting out clock uncertainty). We may see “mixed consistency” databases – where some operations are strongly consistent and others eventual, within the same system (developers choose per operation). In cloud projects, it’s increasingly common to use multiple data stores for different needs (a strongly consistent store for critical data, an eventually consistent NoSQL for others). Cloud providers now offer a spectrum: Azure Cosmos DB, for example, lets you tune the consistency level per request (strong, session, eventual, etc.), bringing flexibility. The future may bring more adaptive consistency, where the system itself can strengthen or weaken consistency based on context like network conditions or required SLA.
    • Saga Pattern for Distributed Transactions: In microservice architectures, a pattern called Saga has gained popularity. A Saga is essentially a long-lived transaction composed of a sequence of local transactions, each with a corresponding compensating action if something fails mid-way. For example, a travel booking Saga might reserve a flight, reserve a hotel, and then payment – each step is a normal operation in each service, and if one fails, previous reservations are canceled (compensation). This avoids holding locks across services or using 2PC, and instead relies on eventually consistent cleanup. Tools and frameworks for sagas are emerging (Netflix Conductor, Camunda, Temporal.io etc.), often integrating with cloud function workflows. Sagas trade immediate consistency for resilience: all-or-none outcome is achieved but over time and with possible retries. As orchestration systems improve, sagas are becoming easier to implement, and their importance will grow for maintaining data integrity in distributed business processes. In cloud project management, one must design robust compensating actions and idempotent operations for saga steps.

    Distributed Transactions in Microservices. Details in caption.

    Figure \(\PageIndex{1}\): Saga Pattern for Distributed Transactions in Microservices (CC BY 4.0; Felix Amoruwa) Access to a detailed description of Figure \(\PageIndex{1}\)
    • Blockchain and Consensus Protocols: It’s worth noting that ideas from the blockchain world (decentralized consensus without central trust) are influencing cloud distributed systems too. Algorithms like Paxos and Raft have long underpinned leader election and consistency in distributed databases. Now, more Byzantine-resistant and scalable consensus protocols (inspired by blockchain research) might trickle into mainstream clouds for certain use cases (e.g., tamper-evident logging, cross-organization transactions). Distributed ledger services (like Amazon QLDB or Azure Confidential Ledger) provide transactional logs with cryptographic verification. While not a fit for all scenarios, these ensure an immutable sequence of transactions verified by consensus, which can be seen as an extreme form of event sourcing with trust guarantees. The future cloud may offer “consensus as a service” – enabling multiple parties to transact on shared data without a single owner, useful in supply chain, finance, etc.

    Why All This Matters: As applications become cloud-native, old assumptions (a single database, a single big server handling a transaction) no longer hold. Users expect distributed apps (e.g. collaborative editing, multi-region e-commerce) to be highly responsive and available. The CAP theorem famously states you can’t have perfect Consistency, Availability, and Partition tolerance all at once in a distributed system. The emerging practices we discussed (CRDTs, eventual consistency, sagas) show how engineers are rebalancing these trade-offs, often favoring availability and partition tolerance, but finding new ways to still get correctness (perhaps in a weaker sense or deferred).

    Martin Kleppmann, a researcher in distributed data, argues that the strict traditional definitions (like linearizability in CAP) are too narrow, and real systems operate in a more nuanced space. For instance, many cloud databases are “AP but with tunable consistency”, or even just “P” (they may sacrifice both absolute consistency and absolute availability to optimize latency or other goals). The takeaway is that future cloud architectures will employ a mix of consistency models – strong consistency where necessary (e.g. account balances) and looser consistency elsewhere (e.g. user preferences syncing).

    For cloud project managers, it will be essential to understand these models to make informed design decisions. One might use AWS DynamoDB (eventually consistent by default) for one part of a system and Spanner or Azure SQL Hyperscale (strong consistency) for another, and then use an event-driven approach to synchronize between them.

    In Practice – Example: Consider a global ride-sharing application. It might use event sourcing to log ride requests and driver locations (ensuring an eventual consistent view of the dispatch state that can tolerate network splits), CRDTs for things like concurrent updates to a driver’s schedule (resolving conflicts if two dispatchers try to assign different rides – e.g. last-assigned wins or a merge rule), and a saga to handle the payment workflow across billing, driver payout, and receipt generation (so that if one step fails, preceding steps are compensated). Using these techniques, the system achieves high availability and user responsiveness, without giving up the ability to reconcile and correct state when needed.

    As we move forward, expect cloud providers and frameworks to increasingly bake in support for these patterns. For example, Azure’s Service Fabric and Dapr frameworks provide actors and reliable state with optional transactional semantics; AWS’s Step Functions facilitates saga-like orchestrations; many cloud databases now have multi-region replication with CRDT-based conflict resolution (like Cosmos DB’s “last write wins” or custom conflict resolvers). Academic research too is vibrant – from CALM theorem (Consistency as Logical Monotonicity) which provides conditions under which eventual consistency yields a deterministic outcome, to new CRDT variants that handle more complex data.

    In conclusion, the future of distributed transactions is not one-size-fits-all. It will involve a toolkit of approaches. Cloud professionals will need to choose the right approach for each component: sometimes you will use a strict transaction, other times an eventually consistent CRDT update or an append-only event. The exciting development is that cloud platforms are making these choices available at a high level. The result will be cloud systems that are both more scalable and more robust in the face of failures, without sacrificing the correctness of critical data. Embracing these new paradigms is key to architecting systems that meet the demanding needs of global, always-on users.


    This page titled 14.3.2: New Consistency Models and Distributed Transaction Techniques was last modified on Tue, 22 Sep 2026 21:13:46 GMT and is shared under a CC BY 4.0 license and was authored, remixed, and/or curated by Felix Amoruwa.