H2 Database vs HyperSQL (HSQLDB)
H2 Database: Fast pure-Java SQL engine for embedded, in-memory and test databases, with compatibility modes. HyperSQL (HSQLDB): Long-running pure-Java SQL database with strong SQL:2023 coverage, used embedded and in LibreOffice.
key differences
- Licensing: H2 Database is open source (copyleft) (MPL 2.0 or EPL 1.0 (dual)); HyperSQL (HSQLDB) is open source (permissive) (HSQLDB License (BSD-style)).
- Only H2 Database has full-text search, geospatial, json, compression.
- Only HyperSQL (HSQLDB) has time travel.
choose h2 for
- +Integration tests for Spring/JPA applications
- +Embedded storage in Java desktop tools
- +Prototyping before choosing a production database
- +In-memory scratch databases in batch jobs
best at · Embedded, OLTP, Coordination
choose hsqldb for
- +Embedded storage in Java applications
- +Unit tests needing strict SQL semantics
- +LibreOffice Base documents
- +Teaching SQL standard features
best at · Embedded, OLTP
H2 Database vs HyperSQL (HSQLDB): FAQ
What is the difference between H2 Database and HyperSQL (HSQLDB)?
H2 Database: Fast pure-Java SQL engine for embedded, in-memory and test databases, with compatibility modes. HyperSQL (HSQLDB): Long-running pure-Java SQL database with strong SQL:2023 coverage, used embedded and in LibreOffice. Licensing: H2 Database is open source (copyleft) (MPL 2.0 or EPL 1.0 (dual)); HyperSQL (HSQLDB) is open source (permissive) (HSQLDB License (BSD-style)). Only H2 Database has full-text search, geospatial, json, compression. Only HyperSQL (HSQLDB) has time travel.
When should I choose H2 Database over HyperSQL (HSQLDB)?
Choose H2 Database for integration tests for Spring/JPA applications, embedded storage in Java desktop tools and prototyping before choosing a production database. Choose HyperSQL (HSQLDB) for embedded storage in Java applications, unit tests needing strict SQL semantics and LibreOffice Base documents.
Is H2 Database or HyperSQL (HSQLDB) more popular?
H2 Database ranks #128 on the WhichDB Score (23.5/100) and HyperSQL (HSQLDB) ranks #312 (9.4/100). Popularity is not fit: check the requirements that matter for your project.
Are H2 Database and HyperSQL (HSQLDB) open source?
Yes. H2 Database is open source. License: MPL 2.0 or EPL 1.0 (dual). Yes. HyperSQL (HSQLDB) is open source. License: HSQLDB License (BSD-style).