Compare with

Comparison of DataNucleus with Derby server vs Hibernate 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
 DataNucleus
Derby server
Hibernate
PostgreSQL server
DataNucleus
Derby server
Hibernate
PostgreSQL server
DataNucleus
Derby server
Hibernate
PostgreSQL server
Basic Person Test2.87.12.33.42.65.2
Element Collection Test0.712.90.351.70.532.3
Inheritance Test2.77.02.03.62.35.3
Indexing Test4.59.34.06.14.37.7
Graph (Binary Tree) Test0.623.00.532.90.572.9
Multithreading Test4.931.73.413.94.122.8
All Tests2.710.22.15.32.47.7

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
 DataNucleus
Derby server
Hibernate
PostgreSQL server
DataNucleus
Derby server
Hibernate
PostgreSQL server
DataNucleus
Derby server
Hibernate
PostgreSQL server
Basic Person Test0.565.56.311.53.48.5
Element Collection Test0.360.0250.930.0170.640.021
Inheritance Test0.455.26.814.03.69.6
Indexing Test0.504.67.113.33.88.9
Graph (Binary Tree) Test0.220.616.60.783.40.70
Multithreading Test1.211.310.017.05.614.2
All Tests0.554.56.39.43.47.0

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
 DataNucleus
Derby server
Hibernate
PostgreSQL server
DataNucleus
Derby server
Hibernate
PostgreSQL server
DataNucleus
Derby server
Hibernate
PostgreSQL server
Basic Person Test37.755.53.66.120.730.8
Element Collection Test25.911.01.40.01613.65.5
Inheritance Test6.552.31.88.74.230.5
Indexing Test0.0300.0504.98.82.54.4
Multithreading Testfailed55.2failed9.2failed32.2
All Tests17.534.82.96.610.220.7

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
 DataNucleus
Derby server
Hibernate
PostgreSQL server
DataNucleus
Derby server
Hibernate
PostgreSQL server
DataNucleus
Derby server
Hibernate
PostgreSQL server
Basic Person Test1.15.30.852.70.994.0
Element Collection Test0.810.0670.620.0260.710.046
Inheritance Test1.25.41.33.81.24.6
Indexing Test1.25.41.54.31.34.8
Graph (Binary Tree) Test0.291.10.410.580.350.82
Multithreading Testfailed29.6failed6.3failed18.0
All Tests0.937.80.922.90.925.4

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
 DataNucleus
Derby server
Hibernate
PostgreSQL server
DataNucleus
Derby server
Hibernate
PostgreSQL server
DataNucleus
Derby server
Hibernate
PostgreSQL server
Basic Person Test1.35.31.34.21.34.8
Element Collection Test0.610.0200.33stopped0.470.0098
Inheritance Test1.05.11.34.21.24.6
Indexing Test2.39.51.96.32.17.9
Graph (Binary Tree) Test0.260.0120.460.0120.360.012
Multithreading Testfailed23.3failed21.8failed22.5
All Tests1.17.21.16.11.16.6

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
 DataNucleus
Derby server
Hibernate
PostgreSQL server
DataNucleus
Derby server
Hibernate
PostgreSQL server
DataNucleus
Derby server
Hibernate
PostgreSQL server
Basic Person Test8.715.72.95.65.810.7
Element Collection Test5.72.80.720.353.21.6
Inheritance Test2.415.02.66.92.510.9
Indexing Test1.75.83.97.82.86.8
Graph (Binary Tree) Test0.351.22.01.11.21.1
Multithreading Test3.030.26.713.64.921.9
All Tests3.812.12.86.03.39.1

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