Compare with

Comparison of Hibernate with Derby embedded 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
Derby embedded
DataNucleus
PostgreSQL server
Hibernate
Derby embedded
DataNucleus
PostgreSQL server
Hibernate
Derby embedded
DataNucleus
PostgreSQL server
Basic Person Test5.94.13.82.64.93.3
Element Collection Test2.90.911.80.382.30.64
Inheritance Test5.33.83.72.44.53.1
Indexing Test7.06.04.86.45.96.2
Graph (Binary Tree) Test1.90.911.70.771.80.84
Multithreading Test10.518.03.78.37.113.1
All Tests5.65.63.33.54.44.5

The results above show that in general DataNucleus with PostgreSQL server is slightly more efficient than Hibernate with Derby embedded 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 Derby embedded database (3.7) to the normalized speed of DataNucleus with PostgreSQL database server (8.3) reveals that in that case, DataNucleus with PostgreSQL server is 2.2 times faster than Hibernate with Derby embedded.

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
Derby embedded
DataNucleus
PostgreSQL server
Hibernate
Derby embedded
DataNucleus
PostgreSQL server
Hibernate
Derby embedded
DataNucleus
PostgreSQL server
Basic Person Test14.21.716.47.615.34.6
Element Collection Test4.40.734.90.634.60.68
Inheritance Test10.31.518.69.314.45.4
Indexing Test10.01.516.49.213.25.3
Graph (Binary Tree) Test2.62.63.012.32.87.4
Multithreading Test19.33.419.310.819.37.1
All Tests10.11.913.18.311.65.1

The results above show that in general Hibernate with Derby embedded is more efficient than DataNucleus with PostgreSQL server in retrieving JPA entity objects from the database. Comparing the normalized speed of DataNucleus with PostgreSQL database server (5.1) to the normalized speed of Hibernate with Derby embedded database (11.6) reveals that in these tests, Hibernate with Derby embedded is 2.3 times faster than DataNucleus with PostgreSQL server.

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

On the other hand, Hibernate with Derby embedded is slower, for instance, when using graphs of objects with large retrieval size. Comparing the normalized speed of Hibernate with Derby embedded database (3.0) to the normalized speed of DataNucleus with PostgreSQL database server (12.3) reveals that in that case, Hibernate with Derby embedded is 4.1 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
Derby embedded
DataNucleus
PostgreSQL server
Hibernate
Derby embedded
DataNucleus
PostgreSQL server
Hibernate
Derby embedded
DataNucleus
PostgreSQL server
Basic Person Test49.349.16.84.728.126.9
Element Collection Test37.639.12.70.4820.119.8
Inheritance Test24.155.97.66.615.931.2
Indexing Test5.30.04814.86.410.13.2
Multithreading Test39.7failed6.1failed22.9failed
All Tests31.236.07.64.519.420.3

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

The results above show that in general DataNucleus with PostgreSQL server is slightly more efficient than Hibernate with Derby embedded in executing the tested JPA queries.

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

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 Derby embedded database (5.3) reveals that in that case, DataNucleus with PostgreSQL server is 110 times slower than Hibernate with Derby embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
Derby embedded
DataNucleus
PostgreSQL server
Hibernate
Derby embedded
DataNucleus
PostgreSQL server
Hibernate
Derby embedded
DataNucleus
PostgreSQL server
Basic Person Test4.52.13.20.843.81.5
Element Collection Test3.91.43.10.643.51.0
Inheritance Test4.62.14.51.24.51.7
Indexing Test4.62.25.51.55.11.8
Graph (Binary Tree) Test2.70.651.20.202.00.42
Multithreading Test11.60.462.6failed7.10.46
All Tests5.31.53.30.874.31.2

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

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

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
Derby embedded
DataNucleus
PostgreSQL server
Hibernate
Derby embedded
DataNucleus
PostgreSQL server
Hibernate
Derby embedded
DataNucleus
PostgreSQL server
Basic Person Test3.83.04.21.34.02.2
Element Collection Test2.31.01.50.391.90.69
Inheritance Test4.02.84.31.34.22.1
Indexing Test5.55.43.61.94.63.7
Graph (Binary Tree) Test0.740.380.960.370.850.37
Multithreading Test5.613.84.9failed5.313.8
All Tests3.74.43.31.13.52.9

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

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

A large performance gap has been detected when using JPA element collections with large transaction size. Comparing the normalized speed of DataNucleus with PostgreSQL database server (0.39) to the normalized speed of Hibernate with Derby embedded database (1.5) reveals that in that case, Hibernate with Derby embedded is 3.8 times faster than DataNucleus with PostgreSQL server.

On the other hand, Hibernate with Derby embedded is slower, for instance, when using multithreading with small transaction size. Comparing the normalized speed of Hibernate with Derby embedded database (5.6) to the normalized speed of DataNucleus with PostgreSQL database server (13.8) reveals that in that case, Hibernate with Derby embedded is 2.5 times slower than DataNucleus with PostgreSQL server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
Derby embedded
DataNucleus
PostgreSQL server
Hibernate
Derby embedded
DataNucleus
PostgreSQL server
Hibernate
Derby embedded
DataNucleus
PostgreSQL server
Basic Person Test15.512.06.93.411.27.7
Element Collection Test10.28.62.80.506.54.6
Inheritance Test9.713.27.74.28.78.7
Indexing Test6.53.09.05.17.84.0
Graph (Binary Tree) Test2.01.11.73.41.82.3
Multithreading Test17.38.97.39.512.39.1
All Tests10.58.06.13.88.36.0

The results above show that in general Hibernate with Derby embedded is more efficient than DataNucleus with PostgreSQL server in performing JPA database operations.

A large performance gap has been detected when using JPA element collections with large transaction/retrieval size. Comparing the normalized speed of DataNucleus with PostgreSQL database server (0.50) to the normalized speed of Hibernate with Derby embedded database (2.8) reveals that in that case, Hibernate with Derby embedded is 5.6 times faster than DataNucleus with PostgreSQL server.

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

Other Head to Head DBMS/JPA Comparisons