JTA/XA reliability without the performance overhead
Distributed transactions without the performance cost

| | , | , , ,

Who said distributed transactions would cost in terms of performance? Now you can go as fast as with plain JDBC!

Our GitHub benchmark repo contains performance benchmarking code to test the relative overhead of JTA/XA transactions versus regular JDBC transactions. We do this by comparing a similar application scenario with a JTA/XA pool versus with a regular JDBC pool. Both are connected to a PostgreSQL database.

To make sure that the comparison makes sense, we use only one datasource so we are comparing similar things: it would not make sense to compare the full two-phase commit to regular JDBC. However, it does make sense to compare the XA overhead of a 1-phase commit scenario to the performance of a non-XA application with a state-of-the art JDBC pool.

What we found is that the overhead of JTA/XA is negligible in case of network delays to the backend resource (i.e., not using a collocated DBMS). When collocated, JTA/XA results are a bit slower - probably because connection reuse is delayed until the transaction completes (which takes slightly longer than with plain JDBC, thereby making the pool less efficient) and because our open source product includes some logging overhead that is reduced in our commercial products.

Here are the detailed measurements:

Pool used XA? Average performance (transactions per second) Standard deviation
Atomikos YES 310 40
DBCP NO 300 40
Hikari NO 320 60
Assuming a normal distribution (which we asserted with 100 test runs for each pool) this means that there is no clear distinction between the different pools - because the intervals overlap if you take the deviation into account. The highest performance with XA exceeds the worst performance with non-XA pools. So there is no realistic way of claiming that XA is slower than the the other use cases. Overall, this suggests that for realistic scenarios (where the backend is separate from the application) there is virtually NO overhead in using JTA/XA. So you basically get reliability for free!

If you want even more performance improvements, check out our commercial offering: ExtremeTransactions.

Contact Us

Atomikos Corporate Headquarters
Hoveniersstraat, 39/1, 2800
Mechelen, Belgium

E info@atomikos.com
E sales@atomikos.com
T +3215613055

Subscribe to our newsletter

Never miss an update

Copyright 2018 Atomikos BVBA