H2 Database Engine is the in-memory database for your automated tests
Use Cases and Deployment Scope
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.
Pros
- 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.
Cons
- 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.
Likelihood to Recommend
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.