Distributed transactions

A distributed transaction is a transaction that updates data on two or more networked computer systems. In other words, a few services together in one accord agree whether a certain action happened or not. In practice, most database systems use strong, strict, and two-phase locking to ensure global serializability.

Distributed transactions are often used by services to update data stores atomically. They were frequently used in monolithic applications to ensure reliable action on different data stores. This facilitated proper recovery from failures at the same time. However, the usage of distributed transactions is discouraged nowadays between multiple microservices. There are a few reasons for this, but the most important ones are as follows:

  • A service that allows distributed transactions requires an API that supports two-phase commit and is not very trivial to implement
  • Microservices that are involved in a distributed transaction are tightly coupled, which is always discouraged in a microservices architecture
  • Distributed transactions do not scale, limiting system bandwidth and consequently reducing the scalability of the system
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.204.0