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). The main ideas behind this algorithm are summarized as follows:
The focus for this design is on "optimistic transactions" and the design makes these important assumptions:

Using this design provides the potential for linear scaling. Without centralized lock management, transaction throughput can easily scale with additional members. Transaction processing involves the data stores plus a coordinating peer. Thus if the concurrent transaction workload is uniformly spread across the data set, 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 hosts. Transaction performance is also increased, as compared to transactions that use a centralized lock manager.