Skip to main content
H2 Database

H2 Database


What is H2 Database?

H2 Database Engine is an open source, embeddable database management system (RDMS) written in Java.

Read more
Recent Reviews

For simplicity

8 out of 10
May 14, 2021
[H2 Database Engine is] being used for two different purposes. One is for running unit tests for application during compilation phase. …
Continue reading
Read all reviews
Return to navigation

Product Details

What is H2 Database?

H2 Database Technical Details

Operating SystemsUnspecified
Mobile ApplicationNo
Return to navigation


View all alternatives
Return to navigation

Reviews and Ratings



(1-2 of 2)
Companies can't remove reviews or game the system. Here's why
Score 8 out of 10
Vetted Review
Verified User
H2 Database Engine is primarily used for running application test cases by our development team. When changes are made to our codebase, we run automated test cases, and when the test case involves data manipulation, H2 Database Engine is used instead of a full blown database such as PostgreSQL. H2 Database Engine is lightweight, simple and runs in-memory, which makes it perfect for this use case.
  • Can run as an in-memory database.
  • Simple and quick to get started with, and is light weight (only 2MB).
  • SQL compliant so it compatible with most relational databases.
  • There really is not a lot to say here as H2 Database Engine is not a general purpose database such as PostgreSQL or MySQL, so it has a niche use case for being an in-memory database, and it is very good at doing that. Perhaps one slight improvement would be some SQL queries that work with MySQL or PostgreSQL do not work with H2 Database Engine, and so if H2 Database Engine is used as an in-memory replacement for testing, that would create false negatives.
  • If H2 Database Engine can support some NoSQL databases, it would be fantastic.
This really depends on the use case. For an in-memory replacement database for running unit test cases with, H2 Database Engine is an excellent option. However, if you are looking for a general purpose database for your production systems, then H2 Database Engine is not suited for this purpose.
  • Light weight and in-memory
  • SQL compliant
  • Improved code quality by allowing the team to run automated test cases.
  • Reduced infrastructure cost as we no longer need to have dedicated databases just for testing.
While both can run as an in-memory database, H2 Database Engine was just so much easier for us to use since we primarily use the Java stack and H2 Database Engine is also built with Java.
May 14, 2021

For simplicity

Score 8 out of 10
Vetted Review
Verified User
[H2 Database Engine is] being used for two different purposes. One is for running unit tests for application during compilation phase. This application runs is MySQL database normally, but for unit test purposes that is impractical. In compilation phase an in-memory H2 database is constructed and application tests are run against that. Another purpose is a small authentication security web-application that runs in a single instance. In this case some authentication related details are stored in H2 database that is stored to disk.
  • Simple setup, only needs a dependency added to application & few config lines.
  • Quick startup
  • Easy to use, existing code for MySQL works with H2 too
  • There's a warning in official FAQ "Is it Reliable?"-section which makes it seem like H2 is not yet a mature product.
  • If raw SQL queries are used there maybe be differences between MySQL & H2. ORM library should be used.
  • Support seems to be community-based only.
For running application tests it's well suited. H2 [Database Engine] can replace the real-world database solution for them easily and removes the requirement to set up a a separate database instance just for running unit tests. For using in actual production application one needs to consider scale. H2 is suitable if application runs in single instance and database is located in same machine as a file where that application runs. This means the application shouldn't have a large user base. However it's easy to switch to an actual MySQL instance if the need arises, it's most likely only a configuration change and doesn't require new code.
  • Easy setup, developers don't need to setup databases for running tests
  • Persistence, although H2 is often referred as in-memory database, saving the database to disk is easy and data stays between application restarts
  • MySQL compatibility
  • Doesn't take time from developers, once it's configs are set up for testing it works in everyone's development environments
  • Easy to integrate in application, no need to setup separate database software, no maintenance
  • No need to deal with infrastructure related issues/costs - database runs in same machine as the application that uses it.
Both MySQL & H2 [Database Engine] are relational databases & use same query language. Application features can be implemented with both but if it's expected that the application will be used by large user base or is complex MySQL is better. Cloud providers provide scaling support for MySQL and also it's more battle-tested. H2 is good when it's a small application as H2 is easier & quicker to set up.
Amazon Relational Database Service (RDS), Apache Tomcat, MySQL
Return to navigation