vs

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

overview
Primary model
Relational
Relational
Also supports
Spatial
–
Type
Database engine
Database engine
Status
Active
Active
Developer
H2 Group (Thomas Mueller, Evgenij Ryazanov and contributors)
The hsql Development Group
First release
2005
2001
Latest version
2.5.252 (Sep 24, 2026)
2.7.4 (Oct 25, 2024)
License
Open source (copyleft)MPL 2.0 or EPL 1.0 (dual)
Open source (permissive)HSQLDB License (BSD-style)
Free tier
✓
✓
popularity
WhichDB Score
23.5
9.4
Rank
#128
#312
GitHub stars
4.6K
–
Stack Overflow questions
5.1K
2.5K
scale & guarantees
Comfortable data size
Small (≤ 100 GB)
Small (≤ 100 GB)
Horizontal scaling
None
None
Multi-region
None
None
ACID
Full
Full
Consistency
Strong
Strong
Schema
Strict
Strict
Architecture
Embedded, In memory, Client server, Single node
Embedded, In memory, Client server, Single node
deployment
Self-hosted
✓
✓
Vendor-managed cloud
—
—
Serverless
—
—
Embedded
✓
✓
Edge
—
—
Clouds
–
–
capabilities
Transactions
✓
✓
Joins
✓
✓
Secondary indexes
✓
✓
Full-text search
✓
—
Vector search
—
—
Geospatial
✓
—
JSON
✓
—
Change data capture
—
—
Triggers
✓
✓
Stored procedures
✓
✓
Materialized views
—
—
TTL / expiry
—
—
Pub/Sub
—
—
Columnar storage
—
—
In-memory
✓
✓
Durable persistence
✓
✓
Compression
✓
—
Encryption at rest
✓
✓
Role-based access
✓
✓
Time travel
—
✓
Branching
—
—
Online schema changes
—
—
Streaming ingest
—
—
Offline sync
—
—
Runs in WebAssembly
—
—
interfaces
Query languages
SQL
SQL
Client languages
Java
Java
Best for
Embedded, OLTP, Coordination
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).