About H2 Database
H2 is a relational database management system written in Java. It can run embedded inside an application or as a standalone server, and databases can live on disk or purely in memory, which makes it popular for development, testing and small production uses where a full database server would be overkill.
Listed features include a JDBC API, transaction support with multi-version concurrency, a browser-based console application, encrypted databases and full-text search. It is pure Java with a small footprint, about 2.5 MB for the jar, and it also provides an ODBC driver. The project documents SQL commands, functions, aggregate and window functions and data types, and offers a tutorial, issue tracker and forum.
H2 is open source, with its license shown as 'Other' on GitHub, and is added to Java projects as a dependency, so no hosting is needed. It suits Java developers who want a lightweight database for unit tests, prototypes and embedded applications.
Key features
- Embedded and server modes
- In-memory or disk-based databases
- JDBC API and ODBC driver
- Transactions with multi-version concurrency
- Browser-based console application
- Encrypted databases and full-text search
Good fit for
- Fast in-memory databases for tests
- Embedded SQL storage in Java apps
H2 Database: questions and answers
- What is H2 Database used for?
- H2 Database is a fast, embeddable SQL database written in pure Java, with JDBC access, in-memory or disk storage, encryption and a browser-based console. It is a good fit for fast in-memory databases for tests and embedded SQL storage in Java apps.
- Is H2 Database open source?
- Yes. H2 Database is open source under a custom licence. Its source code is on GitHub at h2database/h2database and is written mainly in Java.
- Is H2 Database free?
- Yes. H2 Database is open source, so the software itself is free to use under the terms of its own licence.
- Can I self-host H2 Database?
- Yes. H2 Database can be self-hosted on your own server or infrastructure; there is no official hosted version.
- What is H2 Database an alternative to?
- H2 Database is an open-source alternative to Oracle Database. Other open-source alternatives to Oracle Database include PostgreSQL, ClickHouse and TimescaleDB.
- Is H2 Database actively maintained?
- Yes. The most recent commit to H2 Database was on 12 November 2026. The project has 4.6k stars on GitHub, with 11 added in the last 30 days.
Open-source alternatives to H2 Database
See all
PostgreSQL
Databases
Mirror of the official PostgreSQL GIT repository. Note that this is just a *mirror* - we d
OSSvs Oracle Database★ 23k
ClickHouse
Databases
ClickHouse is a fast open-source column-oriented database management system that allows ge
Apache-2.0vs Snowflake★ 51k
TimescaleDB
Databases
A time-series database for high-performance real-time analytics packaged as a Postgres ext
OSSvs KX kdb+★ 24k
MariaDB
Databases
MariaDB server is a community developed fork of MySQL server. Started by core members of t
GPL-2.0vs Oracle Database★ 8.6k
Neo4j
Databases
Graphs for Everyone
GPL-3.0vs Amazon Neptune★ 17k
MySQL
Databases
MySQL Server, the world's most popular open source database, and MySQL Cluster, a real-tim
OSSvs Oracle Database★ 13k
SaaS alternatives to H2 Database
See all
Oracle Database
Databases
Oracle relational database for enterprise transactional and analytical workloads
SaaS
SAP HANA
Databases
In-memory database and data platform from SAP for transactional and analytical workloads
SaaS
EDB Postgres AI
Databases
Enterprise PostgreSQL distribution, managed service and tooling from EnterpriseDB
SaaS
Google Cloud Spanner
Databases
Google horizontally scalable relational database with strong consistency
SaaS
IBM Db2
Databases
Enterprise relational database with SQL, AI-assisted queries and cloud deployment options
SaaS
InterSystems IRIS
Databases
Multi-model database and interoperability platform used in healthcare and finance
SaaS

