Compare with

Comparison of Hibernate with PostgreSQL server vs DataNucleus with Derby embedded

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 embedded
Hibernate
PostgreSQL server
DataNucleus
Derby embedded
Hibernate
PostgreSQL server
DataNucleus
Derby embedded
Basic Person Test7.14.63.42.85.23.7
Element Collection Test2.92.41.71.62.32.0
Inheritance Test7.04.63.62.75.33.7
Indexing Test9.37.66.14.87.76.2
Graph (Binary Tree) Test3.01.62.91.42.91.5
Multithreading Test31.78.613.93.322.85.9
All Tests10.24.95.32.87.73.8

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
PostgreSQL server
DataNucleus
Derby embedded
Hibernate
PostgreSQL server
DataNucleus
Derby embedded
Hibernate
PostgreSQL server
DataNucleus
Derby embedded
Basic Person Test5.56.811.514.98.510.9
Element Collection Test0.0255.40.0177.60.0216.5
Inheritance Test5.28.814.014.89.611.8
Indexing Test4.69.213.314.18.911.6
Graph (Binary Tree) Test0.619.90.7815.80.7012.9
Multithreading Test11.311.917.011.514.211.7
All Tests4.58.79.413.17.010.9

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

A huge performance gap has been detected 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 embedded database (7.6) reveals that in that case, DataNucleus with Derby embedded is 447 times faster than Hibernate with PostgreSQL server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
PostgreSQL server
DataNucleus
Derby embedded
Hibernate
PostgreSQL server
DataNucleus
Derby embedded
Hibernate
PostgreSQL server
DataNucleus
Derby embedded
Basic Person Test55.539.16.17.530.823.3
Element Collection Test11.046.00.0166.75.526.3
Inheritance Test52.37.78.73.830.55.7
Indexing Test0.0500.0538.88.04.44.0
Multithreading Test55.2failed9.2failed32.2failed
All Tests34.823.26.66.520.714.8

DataNucleus with Derby embedded 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 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 DataNucleus with Derby embedded database (7.7) to the normalized speed of Hibernate with PostgreSQL database server (52.3) reveals that in that case, Hibernate with PostgreSQL server is 6.8 times faster than DataNucleus with Derby embedded.

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
PostgreSQL server
DataNucleus
Derby embedded
Hibernate
PostgreSQL server
DataNucleus
Derby embedded
Hibernate
PostgreSQL server
DataNucleus
Derby embedded
Basic Person Test5.34.02.73.84.03.9
Element Collection Test0.0673.70.0264.50.0464.1
Inheritance Test5.44.43.84.84.64.6
Indexing Test5.45.24.34.24.84.7
Graph (Binary Tree) Test1.12.70.581.50.822.1
Multithreading Test29.6failed6.3failed18.0failed
All Tests7.84.02.93.75.43.9

DataNucleus with Derby embedded 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 embedded in updating JPA entity objects in the database.

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
PostgreSQL server
DataNucleus
Derby embedded
Hibernate
PostgreSQL server
DataNucleus
Derby embedded
Hibernate
PostgreSQL server
DataNucleus
Derby embedded
Basic Person Test5.33.54.21.34.82.4
Element Collection Test0.0201.9stopped1.60.00981.7
Inheritance Test5.12.44.21.34.61.9
Indexing Test9.56.66.31.97.94.3
Graph (Binary Tree) Test0.0120.810.0120.930.0120.87
Multithreading Test23.3failed21.8failed22.5failed
All Tests7.23.06.11.46.62.2

DataNucleus with Derby embedded 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 embedded in deleting JPA entity objects from the database. Comparing the normalized speed of DataNucleus with Derby embedded database (2.2) to the normalized speed of Hibernate with PostgreSQL database server (6.6) reveals that in these tests, Hibernate with PostgreSQL server is 3.0 times faster than DataNucleus with Derby embedded.

A large performance gap has been detected when using database indexes with large transaction size. Comparing the normalized speed of DataNucleus with Derby embedded database (1.9) to the normalized speed of Hibernate with PostgreSQL database server (6.3) reveals that in that case, Hibernate with PostgreSQL server is 3.3 times faster than DataNucleus with Derby embedded.

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

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
PostgreSQL server
DataNucleus
Derby embedded
Hibernate
PostgreSQL server
DataNucleus
Derby embedded
Hibernate
PostgreSQL server
DataNucleus
Derby embedded
Basic Person Test15.711.65.66.110.78.8
Element Collection Test2.811.90.354.41.68.1
Inheritance Test15.05.66.95.510.95.5
Indexing Test5.85.77.86.66.86.2
Graph (Binary Tree) Test1.23.71.14.91.14.3
Multithreading Test30.210.313.67.421.98.8
All Tests12.18.06.05.79.16.9

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

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

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

Other Head to Head DBMS/JPA Comparisons