GemFire XD Transaction Design

GemFire XD implements optimistic transactions. The transaction model is highly optimized for colocated data, where all of the rows updated by a transaction are owned by a single member.

GemFire XD avoids the use of a centralized distributed lock manager and the traditional 2-phase commit protocol. Transactional state is managed on each data store that is affected by the transaction, using only local locks. This allows the cluster to scale even when applications utilize transactions.

When 2-phase commit is used, GemFire XD performs second-phase commit actions in the background, but ensures that the connection that initiated the transaction sees only the committed results. You can change this default behavior using the sync-commits property.

GemFire XD uses an "eager lock, fail fast" algorithm that capitalizes on the fact that updates are reliably and synchronously propagated to all cohorts (mainly replicas) in parallel. The main ideas behind this algorithm are summarized as follows:
The focus of this design is on "optimistic transactions," and the design makes these important assumptions:

Using this design provides the potential for linear scaling, and improves transaction performance as compared to systems that use a centralized lock manager. Without centralized lock management, transaction throughput can easily scale with additional members. Transaction processing involves the data stores plus a coordinating peer. If the concurrent transaction workload is uniformly spread across the data set, then increasing the number of data stores also balances the workload and increases the aggregate transaction throughput. The design also removes the colocation restriction for the transactional working set, because transactions can involve any number of data stores.