[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.