Comparison of Hibernate with Derby embedded 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 Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | Hibernate Derby embedded | Hibernate PostgreSQL server | Hibernate Derby embedded | Hibernate PostgreSQL server | Hibernate Derby embedded | Hibernate PostgreSQL server |
Basic Person Test | 5.9 | 7.1 | 3.8 | 3.4 | 4.9 | 5.2 |
Element Collection Test | 2.9 | 2.9 | 1.8 | 1.7 | 2.3 | 2.3 |
Inheritance Test | 5.3 | 7.0 | 3.7 | 3.6 | 4.5 | 5.3 |
Indexing Test | 7.0 | 9.3 | 4.8 | 6.1 | 5.9 | 7.7 |
Graph (Binary Tree) Test | 1.9 | 3.0 | 1.7 | 2.9 | 1.8 | 2.9 |
Multithreading Test | 10.5 | 31.7 | 3.7 | 13.9 | 7.1 | 22.8 |
All Tests | 5.6 | 10.2 | 3.3 | 5.3 | 4.4 | 7.7 |
The results above show that in general Hibernate with PostgreSQL server is 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 Hibernate with PostgreSQL database server (13.9) reveals that in that case, Hibernate with PostgreSQL server is 3.8 times faster than Hibernate with Derby embedded.
Speed comparison of JPA database retrieval operations (normalized score, higher is better)
Retrieval Size => | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | Hibernate Derby embedded | Hibernate PostgreSQL server | Hibernate Derby embedded | Hibernate PostgreSQL server | Hibernate Derby embedded | Hibernate PostgreSQL server |
Basic Person Test | 14.2 | 5.5 | 16.4 | 11.5 | 15.3 | 8.5 |
Element Collection Test | 4.4 | 0.025 | 4.9 | 0.017 | 4.6 | 0.021 |
Inheritance Test | 10.3 | 5.2 | 18.6 | 14.0 | 14.4 | 9.6 |
Indexing Test | 10.0 | 4.6 | 16.4 | 13.3 | 13.2 | 8.9 |
Graph (Binary Tree) Test | 2.6 | 0.61 | 3.0 | 0.78 | 2.8 | 0.70 |
Multithreading Test | 19.3 | 11.3 | 19.3 | 17.0 | 19.3 | 14.2 |
All Tests | 10.1 | 4.5 | 13.1 | 9.4 | 11.6 | 7.0 |
The results above show that in general Hibernate 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 Hibernate with Derby embedded database (4.9) reveals that in that case, Hibernate with Derby embedded is 288 times faster than Hibernate with PostgreSQL server.
Speed comparison of JPA database query operations (normalized score, higher is better)
Retrieval Size => | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | Hibernate Derby embedded | Hibernate PostgreSQL server | Hibernate Derby embedded | Hibernate PostgreSQL server | Hibernate Derby embedded | Hibernate PostgreSQL server |
Basic Person Test | 49.3 | 55.5 | 6.8 | 6.1 | 28.1 | 30.8 |
Element Collection Test | 37.6 | 11.0 | 2.7 | 0.016 | 20.1 | 5.5 |
Inheritance Test | 24.1 | 52.3 | 7.6 | 8.7 | 15.9 | 30.5 |
Indexing Test | 5.3 | 0.050 | 14.8 | 8.8 | 10.1 | 4.4 |
Multithreading Test | 39.7 | 55.2 | 6.1 | 9.2 | 22.9 | 32.2 |
All Tests | 31.2 | 34.8 | 7.6 | 6.6 | 19.4 | 20.7 |
The results above show that in general Hibernate 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 Hibernate with PostgreSQL database server (52.3) reveals that in that case, Hibernate with PostgreSQL server is 2.2 times faster than Hibernate 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 Hibernate with Derby embedded database (2.7) reveals that in that case, Hibernate with PostgreSQL server is 169 times slower than Hibernate with Derby embedded.
Speed comparison of JPA database update operations (normalized score, higher is better)
Transaction Size => | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | Hibernate Derby embedded | Hibernate PostgreSQL server | Hibernate Derby embedded | Hibernate PostgreSQL server | Hibernate Derby embedded | Hibernate PostgreSQL server |
Basic Person Test | 4.5 | 5.3 | 3.2 | 2.7 | 3.8 | 4.0 |
Element Collection Test | 3.9 | 0.067 | 3.1 | 0.026 | 3.5 | 0.046 |
Inheritance Test | 4.6 | 5.4 | 4.5 | 3.8 | 4.5 | 4.6 |
Indexing Test | 4.6 | 5.4 | 5.5 | 4.3 | 5.1 | 4.8 |
Graph (Binary Tree) Test | 2.7 | 1.1 | 1.2 | 0.58 | 2.0 | 0.82 |
Multithreading Test | 11.6 | 29.6 | 2.6 | 6.3 | 7.1 | 18.0 |
All Tests | 5.3 | 7.8 | 3.3 | 2.9 | 4.3 | 5.4 |
The results above show that in general Hibernate with PostgreSQL server is slightly more efficient than Hibernate with Derby embedded in updating JPA entity objects in the database.
A large performance gap has been detected when using multithreading with small transaction size. Comparing the normalized speed of Hibernate with Derby embedded database (11.6) to the normalized speed of Hibernate with PostgreSQL database server (29.6) reveals that in that case, Hibernate with PostgreSQL server is 2.6 times faster than Hibernate with Derby embedded.
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 Hibernate with Derby embedded database (3.1) reveals that in that case, Hibernate with PostgreSQL server is 119 times slower than Hibernate with Derby embedded.
Speed comparison of JPA database removal operations (normalized score, higher is better)
Transaction Size => | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | Hibernate Derby embedded | Hibernate PostgreSQL server | Hibernate Derby embedded | Hibernate PostgreSQL server | Hibernate Derby embedded | Hibernate PostgreSQL server |
Basic Person Test | 3.8 | 5.3 | 4.2 | 4.2 | 4.0 | 4.8 |
Element Collection Test | 2.3 | 0.020 | 1.5 | stopped | 1.9 | 0.0098 |
Inheritance Test | 4.0 | 5.1 | 4.3 | 4.2 | 4.2 | 4.6 |
Indexing Test | 5.5 | 9.5 | 3.6 | 6.3 | 4.6 | 7.9 |
Graph (Binary Tree) Test | 0.74 | 0.012 | 0.96 | 0.012 | 0.85 | 0.012 |
Multithreading Test | 5.6 | 23.3 | 4.9 | 21.8 | 5.3 | 22.5 |
All Tests | 3.7 | 7.2 | 3.3 | 6.1 | 3.5 | 6.6 |
The results above show that in general Hibernate with PostgreSQL server is more efficient than Hibernate with Derby embedded in deleting JPA entity objects from 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 (4.9) to the normalized speed of Hibernate with PostgreSQL database server (21.8) reveals that in that case, Hibernate with PostgreSQL server is 4.4 times faster than Hibernate 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 Hibernate with Derby embedded database (2.3) reveals that in that case, Hibernate with PostgreSQL server is 115 times slower than Hibernate with Derby embedded.
Comparison of JPA/Database speed - the averages (normalized score, higher is better)
Transaction/Retrieval Size | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | Hibernate Derby embedded | Hibernate PostgreSQL server | Hibernate Derby embedded | Hibernate PostgreSQL server | Hibernate Derby embedded | Hibernate PostgreSQL server |
Basic Person Test | 15.5 | 15.7 | 6.9 | 5.6 | 11.2 | 10.7 |
Element Collection Test | 10.2 | 2.8 | 2.8 | 0.35 | 6.5 | 1.6 |
Inheritance Test | 9.7 | 15.0 | 7.7 | 6.9 | 8.7 | 10.9 |
Indexing Test | 6.5 | 5.8 | 9.0 | 7.8 | 7.8 | 6.8 |
Graph (Binary Tree) Test | 2.0 | 1.2 | 1.7 | 1.1 | 1.8 | 1.1 |
Multithreading Test | 17.3 | 30.2 | 7.3 | 13.6 | 12.3 | 21.9 |
All Tests | 10.5 | 12.1 | 6.1 | 6.0 | 8.3 | 9.1 |
The results above show that in general Hibernate with PostgreSQL server is slightly more efficient than Hibernate with Derby embedded in performing JPA database operations.
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 Hibernate with Derby embedded database (2.8) reveals that in that case, Hibernate with PostgreSQL server is 8.0 times slower than Hibernate with Derby embedded.
Other Head to Head DBMS/JPA Comparisons
Hibernate with Derby embedded against:
- Oracle Database 11g
- IBM DB2 10
- Microsoft SQL Server 2008
- DataNucleus with Derby embedded
- DataNucleus with H2 embedded
- DataNucleus with HSQLDB embedded
- DataNucleus with DB4O embedded
- DataNucleus with Derby server
- DataNucleus with H2 server
- DataNucleus with MySQL server
- DataNucleus with PostgreSQL server
- EclipseLink with Derby embedded
- EclipseLink with H2 embedded
- EclipseLink with HSQLDB embedded
- EclipseLink with SQLite embedded
- EclipseLink with Derby server
- EclipseLink with H2 server
- EclipseLink with MySQL server
- EclipseLink with PostgreSQL server
- Hibernate with H2 embedded
- Hibernate with HSQLDB embedded
- Hibernate with SQLite embedded
- Hibernate with Derby server
- Hibernate with H2 server
- Hibernate with MySQL server
- Hibernate with PostgreSQL server
- OpenJPA with Derby embedded
- OpenJPA with H2 embedded
- OpenJPA with HSQLDB embedded
- OpenJPA with Derby server
- OpenJPA with H2 server
- OpenJPA with MySQL server
- OpenJPA with PostgreSQL server
- ObjectDB embedded
- ObjectDB server
Hibernate with PostgreSQL server against:
- Oracle Database 11g
- IBM DB2 10
- Microsoft SQL Server 2008
- DataNucleus with Derby embedded
- DataNucleus with H2 embedded
- DataNucleus with HSQLDB embedded
- DataNucleus with DB4O embedded
- DataNucleus with Derby server
- DataNucleus with H2 server
- DataNucleus with MySQL server
- DataNucleus with PostgreSQL server
- EclipseLink with Derby embedded
- EclipseLink with H2 embedded
- EclipseLink with HSQLDB embedded
- EclipseLink with SQLite embedded
- EclipseLink with Derby server
- EclipseLink with H2 server
- EclipseLink with MySQL server
- EclipseLink with PostgreSQL server
- Hibernate with Derby embedded
- Hibernate with H2 embedded
- Hibernate with HSQLDB embedded
- Hibernate with SQLite embedded
- Hibernate with Derby server
- Hibernate with H2 server
- Hibernate with MySQL server
- OpenJPA with Derby embedded
- OpenJPA with H2 embedded
- OpenJPA with HSQLDB embedded
- OpenJPA with Derby server
- OpenJPA with H2 server
- OpenJPA with MySQL server
- OpenJPA with PostgreSQL server
- ObjectDB embedded
- ObjectDB server