Compare with

Comparison of Hibernate with PostgreSQL server vs DataNucleus with Derby 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
PostgreSQL server
DataNucleus
Derby server
Hibernate
PostgreSQL server
DataNucleus
Derby server
Hibernate
PostgreSQL server
DataNucleus
Derby server
Basic Person Test7.12.83.42.35.22.6
Element Collection Test2.90.711.70.352.30.53
Inheritance Test7.02.73.62.05.32.3
Indexing Test9.34.56.14.07.74.3
Graph (Binary Tree) Test3.00.622.90.532.90.57
Multithreading Test31.74.913.93.422.84.1
All Tests10.22.75.32.17.72.4

The results above show that in general Hibernate with PostgreSQL server is much more efficient than DataNucleus with Derby server in persisting JPA entity objects to the database. Comparing the normalized speed of DataNucleus with Derby database server (2.4) to the normalized speed of Hibernate with PostgreSQL database server (7.7) reveals that in these tests, Hibernate with PostgreSQL server is 3.2 times faster than DataNucleus with Derby server.

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
PostgreSQL server
DataNucleus
Derby server
Hibernate
PostgreSQL server
DataNucleus
Derby server
Hibernate
PostgreSQL server
DataNucleus
Derby server
Basic Person Test5.50.5611.56.38.53.4
Element Collection Test0.0250.360.0170.930.0210.64
Inheritance Test5.20.4514.06.89.63.6
Indexing Test4.60.5013.37.18.93.8
Graph (Binary Tree) Test0.610.220.786.60.703.4
Multithreading Test11.31.217.010.014.25.6
All Tests4.50.559.46.37.03.4

The results above show that in general Hibernate with PostgreSQL server is more efficient than DataNucleus with Derby server in retrieving JPA entity objects from the database. Comparing the normalized speed of DataNucleus with Derby database server (3.4) to the normalized speed of Hibernate with PostgreSQL database server (7.0) reveals that in these tests, Hibernate with PostgreSQL server is 2.1 times faster than DataNucleus with Derby 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 DataNucleus with Derby database server (0.45) to the normalized speed of Hibernate with PostgreSQL database server (5.2) reveals that in that case, Hibernate with PostgreSQL server is 11.6 times faster than DataNucleus with Derby server.

On the other hand, Hibernate with PostgreSQL server is slower, for instance, when using JPA element collections with large retrieval size. Comparing the normalized speed of Hibernate with PostgreSQL database server (0.017) to the normalized speed of DataNucleus with Derby database server (0.93) reveals that in that case, Hibernate with PostgreSQL server is 54.7 times slower than DataNucleus with Derby server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
PostgreSQL server
DataNucleus
Derby server
Hibernate
PostgreSQL server
DataNucleus
Derby server
Hibernate
PostgreSQL server
DataNucleus
Derby server
Basic Person Test55.537.76.13.630.820.7
Element Collection Test11.025.90.0161.45.513.6
Inheritance Test52.36.58.71.830.54.2
Indexing Test0.0500.0308.84.94.42.5
Multithreading Test55.2failed9.2failed32.2failed
All Tests34.817.56.62.920.710.2

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

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

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

On the other hand, Hibernate with PostgreSQL server is slower, for instance, when using JPA element collections with large retrieval size. Comparing the normalized speed of Hibernate with PostgreSQL database server (0.016) to the normalized speed of DataNucleus with Derby database server (1.4) reveals that in that case, Hibernate with PostgreSQL server is 87.5 times slower than DataNucleus with Derby server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
PostgreSQL server
DataNucleus
Derby server
Hibernate
PostgreSQL server
DataNucleus
Derby server
Hibernate
PostgreSQL server
DataNucleus
Derby server
Basic Person Test5.31.12.70.854.00.99
Element Collection Test0.0670.810.0260.620.0460.71
Inheritance Test5.41.23.81.34.61.2
Indexing Test5.41.24.31.54.81.3
Graph (Binary Tree) Test1.10.290.580.410.820.35
Multithreading Test29.6failed6.3failed18.0failed
All Tests7.80.932.90.925.40.92

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

The results above show that in general Hibernate with PostgreSQL server is much more efficient than DataNucleus with Derby server in updating JPA entity objects in the database. Comparing the normalized speed of DataNucleus with Derby database server (0.92) to the normalized speed of Hibernate with PostgreSQL database server (5.4) reveals that in these tests, Hibernate with PostgreSQL server is 5.9 times faster than DataNucleus with Derby server.

A large performance gap has been detected when using simple basic entities with small transaction size. Comparing the normalized speed of DataNucleus with Derby database server (1.1) to the normalized speed of Hibernate with PostgreSQL database server (5.3) reveals that in that case, Hibernate with PostgreSQL server is 4.8 times faster than DataNucleus with Derby server.

On the other hand, Hibernate with PostgreSQL server is slower, for instance, when using JPA element collections with large transaction size. Comparing the normalized speed of Hibernate with PostgreSQL database server (0.026) to the normalized speed of DataNucleus with Derby database server (0.62) reveals that in that case, Hibernate with PostgreSQL server is 23.8 times slower than DataNucleus with Derby server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
PostgreSQL server
DataNucleus
Derby server
Hibernate
PostgreSQL server
DataNucleus
Derby server
Hibernate
PostgreSQL server
DataNucleus
Derby server
Basic Person Test5.31.34.21.34.81.3
Element Collection Test0.0200.61stopped0.330.00980.47
Inheritance Test5.11.04.21.34.61.2
Indexing Test9.52.36.31.97.92.1
Graph (Binary Tree) Test0.0120.260.0120.460.0120.36
Multithreading Test23.3failed21.8failed22.5failed
All Tests7.21.16.11.16.61.1

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

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

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

On the other hand, Hibernate with PostgreSQL server is slower, for instance, when using graphs of objects with large transaction size. Comparing the normalized speed of Hibernate with PostgreSQL database server (0.012) to the normalized speed of DataNucleus with Derby database server (0.46) reveals that in that case, Hibernate with PostgreSQL server is 38.3 times slower than DataNucleus with Derby server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
PostgreSQL server
DataNucleus
Derby server
Hibernate
PostgreSQL server
DataNucleus
Derby server
Hibernate
PostgreSQL server
DataNucleus
Derby server
Basic Person Test15.78.75.62.910.75.8
Element Collection Test2.85.70.350.721.63.2
Inheritance Test15.02.46.92.610.92.5
Indexing Test5.81.77.83.96.82.8
Graph (Binary Tree) Test1.20.351.12.01.11.2
Multithreading Test30.23.013.66.721.94.9
All Tests12.13.86.02.89.13.3

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

A huge performance gap has been detected when using multithreading with small transaction/retrieval size. Comparing the normalized speed of DataNucleus with Derby database server (3.0) to the normalized speed of Hibernate with PostgreSQL database server (30.2) reveals that in that case, Hibernate with PostgreSQL server is 10.1 times faster than DataNucleus with Derby server.

On the other hand, Hibernate with PostgreSQL server is slower, for instance, when using JPA element collections with large transaction/retrieval size. Comparing the normalized speed of Hibernate with PostgreSQL database server (0.35) to the normalized speed of DataNucleus with Derby database server (0.72) reveals that in that case, Hibernate with PostgreSQL server is 2.1 times slower than DataNucleus with Derby server.

Other Head to Head DBMS/JPA Comparisons