Comparison of OpenJPA with H2 embedded vs OpenJPA 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 Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | OpenJPA H2 embedded | OpenJPA Derby server | OpenJPA H2 embedded | OpenJPA Derby server | OpenJPA H2 embedded | OpenJPA Derby server |
Basic Person Test | 17.1 | 3.1 | 5.8 | 2.7 | 11.5 | 2.9 |
Element Collection Test | 10.9 | 2.0 | 4.9 | 1.7 | 7.9 | 1.8 |
Inheritance Test | 14.3 | 3.0 | 5.9 | 2.3 | 10.1 | 2.6 |
Indexing Test | 24.4 | 4.7 | 13.7 | 4.1 | 19.1 | 4.4 |
Graph (Binary Tree) Test | 6.8 | 0.71 | 6.7 | 0.64 | 6.7 | 0.67 |
Multithreading Test | 34.2 | 6.0 | 10.2 | 3.8 | 22.2 | 4.9 |
All Tests | 17.9 | 3.3 | 7.9 | 2.5 | 12.9 | 2.9 |
The results above show that in general OpenJPA with H2 embedded is much more efficient than OpenJPA with Derby server in persisting JPA entity objects to the database. Comparing the normalized speed of OpenJPA with Derby database server (2.9) to the normalized speed of OpenJPA with H2 embedded database (12.9) reveals that in these tests, OpenJPA with H2 embedded is 4.4 times faster than OpenJPA with Derby server.
A huge performance gap has been detected when using graphs of objects with large transaction size. Comparing the normalized speed of OpenJPA with Derby database server (0.64) to the normalized speed of OpenJPA with H2 embedded database (6.7) reveals that in that case, OpenJPA with H2 embedded is 10.5 times faster than OpenJPA with Derby server.
Speed comparison of JPA database retrieval operations (normalized score, higher is better)
Retrieval Size => | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | OpenJPA H2 embedded | OpenJPA Derby server | OpenJPA H2 embedded | OpenJPA Derby server | OpenJPA H2 embedded | OpenJPA Derby server |
Basic Person Test | 14.6 | 0.78 | 27.2 | 11.6 | 20.9 | 6.2 |
Element Collection Test | 0.0046 | 0.0024 | 4.3 | 1.1 | 2.1 | 0.54 |
Inheritance Test | 0.011 | 0.014 | 7.4 | 5.0 | 3.7 | 2.5 |
Indexing Test | 17.0 | 0.62 | 35.0 | 13.0 | 26.0 | 6.8 |
Graph (Binary Tree) Test | 1.0 | 0.065 | 1.4 | 0.39 | 1.2 | 0.23 |
Multithreading Test | 18.7 | 1.6 | 27.6 | 19.0 | 23.1 | 10.3 |
All Tests | 8.6 | 0.51 | 17.1 | 8.4 | 12.8 | 4.4 |
The results above show that in general OpenJPA with H2 embedded is more efficient than OpenJPA with Derby server in retrieving JPA entity objects from the database. Comparing the normalized speed of OpenJPA with Derby database server (4.4) to the normalized speed of OpenJPA with H2 embedded database (12.8) reveals that in these tests, OpenJPA with H2 embedded is 2.9 times faster than OpenJPA with Derby server.
A huge performance gap has been detected when using database indexes with small retrieval size. Comparing the normalized speed of OpenJPA with Derby database server (0.62) to the normalized speed of OpenJPA with H2 embedded database (17.0) reveals that in that case, OpenJPA with H2 embedded is 27.4 times faster than OpenJPA with Derby server.
Speed comparison of JPA database query operations (normalized score, higher is better)
Retrieval Size => | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | OpenJPA H2 embedded | OpenJPA Derby server | OpenJPA H2 embedded | OpenJPA Derby server | OpenJPA H2 embedded | OpenJPA Derby server |
Basic Person Test | 5.0 | 29.2 | 1.1 | 5.5 | 3.1 | 17.3 |
Element Collection Test | 1.7 | 2.2 | 1.3 | 1.4 | 1.5 | 1.8 |
Inheritance Test | 2.2 | 2.2 | 1.2 | 1.0 | 1.7 | 1.6 |
Indexing Test | 13.8 | 2.2 | 23.2 | 11.7 | 18.5 | 7.0 |
Multithreading Test | 1.4 | 35.5 | 0.60 | 8.3 | 0.99 | 21.9 |
All Tests | 4.8 | 14.3 | 5.5 | 5.6 | 5.1 | 9.9 |
The results above show that in general OpenJPA with Derby server is more efficient than OpenJPA with H2 embedded in executing the tested JPA queries.
A huge performance gap has been detected when using multithreading with small retrieval size. Comparing the normalized speed of OpenJPA with H2 embedded database (1.4) to the normalized speed of OpenJPA with Derby database server (35.5) reveals that in that case, OpenJPA with Derby server is 25.4 times faster than OpenJPA with H2 embedded.
On the other hand, OpenJPA with Derby server is slower, for instance, when using database indexes with small retrieval size. Comparing the normalized speed of OpenJPA with Derby database server (2.2) to the normalized speed of OpenJPA with H2 embedded database (13.8) reveals that in that case, OpenJPA with Derby server is 6.3 times slower than OpenJPA with H2 embedded.
Speed comparison of JPA database update operations (normalized score, higher is better)
Transaction Size => | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | OpenJPA H2 embedded | OpenJPA Derby server | OpenJPA H2 embedded | OpenJPA Derby server | OpenJPA H2 embedded | OpenJPA Derby server |
Basic Person Test | 10.0 | 1.5 | 6.0 | 4.0 | 8.0 | 2.8 |
Element Collection Test | 0.011 | 0.0081 | 3.8 | 1.9 | 1.9 | 0.94 |
Inheritance Test | 0.046 | 0.043 | 5.0 | 3.8 | 2.5 | 1.9 |
Indexing Test | 8.9 | 1.8 | 7.0 | 6.8 | 8.0 | 4.3 |
Graph (Binary Tree) Test | 2.4 | 0.16 | 1.3 | 0.27 | 1.9 | 0.22 |
Multithreading Test | 16.6 | 6.9 | 4.3 | 5.0 | 10.4 | 5.9 |
All Tests | 6.3 | 1.7 | 4.6 | 3.6 | 5.4 | 2.7 |
The results above show that in general OpenJPA with H2 embedded is more efficient than OpenJPA with Derby server in updating JPA entity objects in the database. Comparing the normalized speed of OpenJPA with Derby database server (2.7) to the normalized speed of OpenJPA with H2 embedded database (5.4) reveals that in these tests, OpenJPA with H2 embedded is 2.0 times faster than OpenJPA with Derby server.
A huge performance gap has been detected when using graphs of objects with small transaction size. Comparing the normalized speed of OpenJPA with Derby database server (0.16) to the normalized speed of OpenJPA with H2 embedded database (2.4) reveals that in that case, OpenJPA with H2 embedded is 15.0 times faster than OpenJPA with Derby server.
Speed comparison of JPA database removal operations (normalized score, higher is better)
Transaction Size => | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | OpenJPA H2 embedded | OpenJPA Derby server | OpenJPA H2 embedded | OpenJPA Derby server | OpenJPA H2 embedded | OpenJPA Derby server |
Basic Person Test | 18.3 | 1.4 | 11.1 | 3.7 | 14.7 | 2.5 |
Element Collection Test | 0.012 | 0.0082 | 2.9 | 1.4 | 1.4 | 0.71 |
Inheritance Test | 0.030 | 0.035 | 6.6 | 2.5 | 3.3 | 1.3 |
Indexing Test | 23.2 | 2.3 | 9.7 | 3.5 | 16.4 | 2.9 |
Graph (Binary Tree) Test | 1.8 | 0.13 | 2.4 | 0.35 | 2.1 | 0.24 |
Multithreading Test | 31.2 | 3.6 | 17.3 | 4.0 | 24.2 | 3.8 |
All Tests | 12.4 | 1.3 | 8.3 | 2.6 | 10.4 | 1.9 |
The results above show that in general OpenJPA with H2 embedded is much more efficient than OpenJPA with Derby server in deleting JPA entity objects from the database. Comparing the normalized speed of OpenJPA with Derby database server (1.9) to the normalized speed of OpenJPA with H2 embedded database (10.4) reveals that in these tests, OpenJPA with H2 embedded is 5.5 times faster than OpenJPA with Derby server.
A huge performance gap has been detected when using graphs of objects with small transaction size. Comparing the normalized speed of OpenJPA with Derby database server (0.13) to the normalized speed of OpenJPA with H2 embedded database (1.8) reveals that in that case, OpenJPA with H2 embedded is 13.8 times faster than OpenJPA with Derby server.
Comparison of JPA/Database speed - the averages (normalized score, higher is better)
Transaction/Retrieval Size | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | OpenJPA H2 embedded | OpenJPA Derby server | OpenJPA H2 embedded | OpenJPA Derby server | OpenJPA H2 embedded | OpenJPA Derby server |
Basic Person Test | 13.0 | 7.2 | 10.2 | 5.5 | 11.6 | 6.4 |
Element Collection Test | 2.5 | 0.84 | 3.4 | 1.5 | 3.0 | 1.2 |
Inheritance Test | 3.3 | 1.1 | 5.2 | 2.9 | 4.3 | 2.0 |
Indexing Test | 17.5 | 2.3 | 17.7 | 7.8 | 17.6 | 5.1 |
Graph (Binary Tree) Test | 3.0 | 0.27 | 3.0 | 0.41 | 3.0 | 0.34 |
Multithreading Test | 20.4 | 10.7 | 12.0 | 8.0 | 16.2 | 9.4 |
All Tests | 10.2 | 3.9 | 8.8 | 4.5 | 9.5 | 4.2 |
The results above show that in general OpenJPA with H2 embedded is more efficient than OpenJPA with Derby server in performing JPA database operations. Comparing the normalized speed of OpenJPA with Derby database server (4.2) to the normalized speed of OpenJPA with H2 embedded database (9.5) reveals that in these tests, OpenJPA with H2 embedded is 2.3 times faster than OpenJPA with Derby server.
A huge performance gap has been detected when using graphs of objects with small transaction/retrieval size. Comparing the normalized speed of OpenJPA with Derby database server (0.27) to the normalized speed of OpenJPA with H2 embedded database (3.0) reveals that in that case, OpenJPA with H2 embedded is 11.1 times faster than OpenJPA with Derby server.
Other Head to Head DBMS/JPA Comparisons
OpenJPA with H2 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 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
- Hibernate with PostgreSQL server
- OpenJPA with Derby 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
OpenJPA with Derby 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
- Hibernate with PostgreSQL server
- OpenJPA with Derby embedded
- OpenJPA with H2 embedded
- OpenJPA with HSQLDB embedded
- OpenJPA with H2 server
- OpenJPA with MySQL server
- OpenJPA with PostgreSQL server
- ObjectDB embedded
- ObjectDB server