XA Overhead for Data Sources - Best Practice

I am trying to understand the impact of XA Datasources on performance.

In many applications, it happens that not all transactions must participate in distributed transactions (this means that only a few transactions require distribution / participation in other resources).

Is the performance tradeoff high enough to tune two data sources (one for XA and one for XA)? Again, the answer is that it depends on the scenario, but I'm looking for "best practices."

+4
java performance java-ee distributed-transactions xa
source share
1 answer

You should use XA transactions only when necessary. The XA commit code is 3-4 times the cost of a case other than XA. Most of the costs are due to additional communication. The shorter the transaction, the higher the cost.

There are some XA features that are trying to lower costs: for example, single-phase commit optimization and read-only optimization. Contributing XA may also help if the underlying database and drivers support it.

+4
source share

All Articles