4

I am trying to understand the Impact of XA Datasources on Performance.

In many applications, it happens that not all the transactions need to participate in Distributed Transactions (meaning only a few transactions require to be distributed/participating with other resources).

Is the trade-off of the performance high enough to have two data sources configured (one each for XA and non-XA)? Again, the answer is, it depends on the scenario, but I am looking for "Best Practices".

Sandeep Jindal
  • 14,510
  • 18
  • 83
  • 121

1 Answers1

4

It is worth to use XA transactions only when required. The XA commit code path has a cost of 3-4 times compared to the non-XA case. Most of the cost is caused by the additional communication. The shorter the transaction the higher the cost.

There are some XA features that try to reduce the cost: like 1-Phase commit optimization and the read-only optimization. Also promotable XA can help if the underlying database and drivers support it.

steve
  • 5,870
  • 1
  • 21
  • 22