In a distributed DBMS, a single transaction can access data stored at more than one site. Such a transaction is called a distributed transaction (or global transaction).

Even though the user sees one transaction, the DBMS must coordinate multiple local transactions at different sites to ensure consistency across the entire system.

What Is a Distributed Transaction?

A distributed (global) transaction is a transaction that:

  • Reads or writes data from two or more different sites.

  • Appears to the user as one atomic unit: it either fully commits or fully aborts.

For example:

  • A banking transfer that deducts money from an account in Site‑A and deposits it into an account in Site‑B.

  • The system must ensure that both operations succeed together, or neither happens.

Each participating site runs its own local transaction, but the global transaction coordinator ensures that all local transactions behave as parts of one bigger transaction.

Local vs Global Transactions

  • Local transaction:

    • Runs entirely within one site.

    • Managed only by that site’s DBMS using normal concurrency and recovery mechanisms.

  • Global (distributed) transaction:

    • Spans multiple sites.

    • Involves communication and coordination between sites to maintain atomicity, consistency, and durability.

The challenge is that network failures, site crashes, or delays can break coordination if the system is not designed carefully.

Why Distributed Transactions Are Hard

  • Partial success:

    • One site might commit, another might fail; the global transaction must ensure all or nothing.

  • Network failures:

    • A site may become unreachable mid‑transaction; the system must still reach a consistent decision.

  • Concurrency and locking:

    • Locks and conflicts must be managed across sites, which increases complexity and latency.

  • Recovery:

    • If a site crashes after a commit, the other sites must still be able to recover the correct state.

Because of these difficulties, distributed DBMSs use special protocols, such as the Two‑Phase Commit Protocol (2PC), to coordinate distributed transactions safely.

For beginners, a distributed transaction is like a single operation that touches multiple databases; the system must treat all those operations as one unit, so that either everything happens together, or nothing happens at all, even if some sites are far apart or fail temporarily.

Summary

Distributed transactions in DBMS are transactions that access data in multiple sites while still behaving as a single atomic unit. Each site runs a local transaction, and a global coordinator ensures that the whole transaction commits or aborts consistently. Distributed transactions are essential for applications that need global consistency (like banking or inventory systems), but they require extra coordination and protocols to handle failures and ensure reliability.