Compare with

Comparison of Hibernate with MySQL server vs DataNucleus with PostgreSQL server

Each of the following tables focuses on a specific database operation, where the last table presents average results comparison.

Speed comparison of JPA database persistence operations (normalized score, higher is better)

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
MySQL server
DataNucleus
PostgreSQL server
Hibernate
MySQL server
DataNucleus
PostgreSQL server
Hibernate
MySQL server
DataNucleus
PostgreSQL server
Basic Person Test3.64.11.62.62.63.3
Element Collection Test1.60.910.720.381.10.64
Inheritance Test3.73.81.62.42.73.1
Indexing Test5.46.02.66.44.06.2
Graph (Binary Tree) Test1.50.911.20.771.40.84
Multithreading Test7.418.02.98.35.213.1
All Tests3.95.61.83.52.84.5

The results above show that in general DataNucleus with PostgreSQL server is more efficient than Hibernate with MySQL server in persisting JPA entity objects to the database.

A large performance gap has been detected when using multithreading with large transaction size. Comparing the normalized speed of Hibernate with MySQL database server (2.9) to the normalized speed of DataNucleus with PostgreSQL database server (8.3) reveals that in that case, DataNucleus with PostgreSQL server is 2.9 times faster than Hibernate with MySQL server.

Speed comparison of JPA database retrieval operations (normalized score, higher is better)

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
MySQL server
DataNucleus
PostgreSQL server
Hibernate
MySQL server
DataNucleus
PostgreSQL server
Hibernate
MySQL server
DataNucleus
PostgreSQL server
Basic Person Test3.01.711.07.67.04.6
Element Collection Test0.340.731.20.630.790.68
Inheritance Test1.31.514.59.37.95.4
Indexing Test2.51.512.89.27.65.3
Graph (Binary Tree) Test0.552.60.7112.30.637.4
Multithreading Test0.233.413.810.87.07.1
All Tests1.31.99.08.35.25.1

The results above show that in general Hibernate with MySQL server is slightly more efficient than DataNucleus with PostgreSQL server in retrieving JPA entity objects from the database.

On the other hand, Hibernate with MySQL server is slower, for instance, when using graphs of objects with large retrieval size. Comparing the normalized speed of Hibernate with MySQL database server (0.71) to the normalized speed of DataNucleus with PostgreSQL database server (12.3) reveals that in that case, Hibernate with MySQL server is 17.3 times slower than DataNucleus with PostgreSQL server.

Speed comparison of JPA database query operations (normalized score, higher is better)

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
MySQL server
DataNucleus
PostgreSQL server
Hibernate
MySQL server
DataNucleus
PostgreSQL server
Hibernate
MySQL server
DataNucleus
PostgreSQL server
Basic Person Test10.049.12.04.76.026.9
Element Collection Test6.739.10.530.483.619.8
Inheritance Test2.855.91.66.62.231.2
Indexing Test0.440.0482.06.41.23.2
Multithreading Test2.1failed0.98failed1.5failed
All Tests4.436.01.44.52.920.3

DataNucleus with PostgreSQL server has failed in 2 tests (see exceptions).

The results above show that in general DataNucleus with PostgreSQL server is much more efficient than Hibernate with MySQL server in executing the tested JPA queries. Comparing the normalized speed of Hibernate with MySQL database server (2.9) to the normalized speed of DataNucleus with PostgreSQL database server (20.3) reveals that in these tests, DataNucleus with PostgreSQL server is 7.0 times faster than Hibernate with MySQL server.

A huge performance gap has been detected when using class inheritance in the object model with small retrieval size. Comparing the normalized speed of Hibernate with MySQL database server (2.8) to the normalized speed of DataNucleus with PostgreSQL database server (55.9) reveals that in that case, DataNucleus with PostgreSQL server is 20.0 times faster than Hibernate with MySQL server.

On the other hand, DataNucleus with PostgreSQL server is slower, for instance, when using database indexes with small retrieval size. Comparing the normalized speed of DataNucleus with PostgreSQL database server (0.048) to the normalized speed of Hibernate with MySQL database server (0.44) reveals that in that case, DataNucleus with PostgreSQL server is 9.2 times slower than Hibernate with MySQL server.

Speed comparison of JPA database update operations (normalized score, higher is better)

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
MySQL server
DataNucleus
PostgreSQL server
Hibernate
MySQL server
DataNucleus
PostgreSQL server
Hibernate
MySQL server
DataNucleus
PostgreSQL server
Basic Person Test0.732.11.60.841.21.5
Element Collection Test0.391.41.20.640.781.0
Inheritance Test0.612.12.11.21.41.7
Indexing Test0.812.22.61.51.71.8
Graph (Binary Tree) Test0.690.650.400.200.540.42
Multithreading Test0.630.463.0failed1.80.46
All Tests0.641.51.80.871.21.2

DataNucleus with PostgreSQL server has failed in 1 tests (see exceptions).

The results above show that in general Hibernate with MySQL server is equivalent to DataNucleus with PostgreSQL server in updating JPA entity objects in the database.

A large performance gap has been detected when using graphs of objects with large transaction size. Comparing the normalized speed of DataNucleus with PostgreSQL database server (0.20) to the normalized speed of Hibernate with MySQL database server (0.40) reveals that in that case, Hibernate with MySQL server is 2.0 times faster than DataNucleus with PostgreSQL server.

On the other hand, Hibernate with MySQL server is slower, for instance, when using JPA element collections with small transaction size. Comparing the normalized speed of Hibernate with MySQL database server (0.39) to the normalized speed of DataNucleus with PostgreSQL database server (1.4) reveals that in that case, Hibernate with MySQL server is 3.6 times slower than DataNucleus with PostgreSQL server.

Speed comparison of JPA database removal operations (normalized score, higher is better)

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
MySQL server
DataNucleus
PostgreSQL server
Hibernate
MySQL server
DataNucleus
PostgreSQL server
Hibernate
MySQL server
DataNucleus
PostgreSQL server
Basic Person Test1.13.01.71.31.42.2
Element Collection Test0.211.00.530.390.370.69
Inheritance Test0.652.81.81.31.22.1
Indexing Test0.815.42.01.91.43.7
Graph (Binary Tree) Test0.550.380.620.370.580.37
Multithreading Test0.3513.84.1failed2.213.8
All Tests0.614.41.81.11.22.9

DataNucleus with PostgreSQL server has failed in 1 tests (see exceptions).

The results above show that in general DataNucleus with PostgreSQL server is more efficient than Hibernate with MySQL server in deleting JPA entity objects from the database. Comparing the normalized speed of Hibernate with MySQL database server (1.2) to the normalized speed of DataNucleus with PostgreSQL database server (2.9) reveals that in these tests, DataNucleus with PostgreSQL server is 2.4 times faster than Hibernate with MySQL server.

A huge performance gap has been detected when using multithreading with small transaction size. Comparing the normalized speed of Hibernate with MySQL database server (0.35) to the normalized speed of DataNucleus with PostgreSQL database server (13.8) reveals that in that case, DataNucleus with PostgreSQL server is 39.4 times faster than Hibernate with MySQL server.

Comparison of JPA/Database speed - the averages (normalized score, higher is better)

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
MySQL server
DataNucleus
PostgreSQL server
Hibernate
MySQL server
DataNucleus
PostgreSQL server
Hibernate
MySQL server
DataNucleus
PostgreSQL server
Basic Person Test3.712.03.63.43.67.7
Element Collection Test1.88.60.840.501.34.6
Inheritance Test1.813.24.34.23.18.7
Indexing Test2.03.04.45.13.24.0
Graph (Binary Tree) Test0.831.10.733.40.782.3
Multithreading Test2.18.95.09.53.69.1
All Tests2.18.03.23.82.76.0

The results above show that in general DataNucleus with PostgreSQL server is more efficient than Hibernate with MySQL server in performing JPA database operations. Comparing the normalized speed of Hibernate with MySQL database server (2.7) to the normalized speed of DataNucleus with PostgreSQL database server (6.0) reveals that in these tests, DataNucleus with PostgreSQL server is 2.2 times faster than Hibernate with MySQL server.

A large performance gap has been detected when using class inheritance in the object model with small transaction/retrieval size. Comparing the normalized speed of Hibernate with MySQL database server (1.8) to the normalized speed of DataNucleus with PostgreSQL database server (13.2) reveals that in that case, DataNucleus with PostgreSQL server is 7.3 times faster than Hibernate with MySQL server.

Other Head to Head DBMS/JPA Comparisons