H2 ("Hypersonic 2") is an open-source lightweight relational database management system implemented in Java, supporting standard SQL API and JDBC API, as well as PostgreSQL ODBC driver. H2 is characterized by its fast performance and low memory requirement. H2 can be either embedded into a Java application or used as a database server. Both in-memory and disk-based database configurations are available. H2 also has strong security features.[05]
- Source Code
- https://github.com/h2database/h2database[02]
- @h2database
- Developer
- Country of Origin
- CH
- Start Year
- 2004 [06]
- Project Type
- Open Source
- Written in
- Java
- Supported Languages
- Java
- Compatible With
- HyperSQL, PostgreSQL
- Operating System
- All OS with Java VM
- Licenses
- Eclipse Public License, Mozilla Public License
H2 ("Hypersonic 2") is an open-source lightweight relational database management system implemented in Java, supporting standard SQL API and JDBC API, as well as PostgreSQL ODBC driver. H2 is characterized by its fast performance and low memory requirement. H2 can be either embedded into a Java application or used as a database server. Both in-memory and disk-based database configurations are available. H2 also has strong security features.[05]
History[06][07]
The development of the H2 database engine started in May 2004, and first published in December 2005. The original developer, Thomas Mueller, also developed the Java database engine Hypersonic SQL (1998 - 2001), which is the origin of HSQLDB. The name H2 stands for Hypersonic 2, but it is built from scratch.
Checkpoints[02]
Two forms of checkpoint creation is supported. "CHECKPOINT" command flushes the data to disk. "CHECKPOINT SYNC" command flushes the data to disk and forces all system buffers be written to the underlying device.
Compression
H2 supports two compression algorithms on objects: LZF and DEFLATE. The default one LZF has faster but lower compression performance, while DEFLATE has higher compression rate.
Concurrency Control[08]
The MVCC mode is enabled by default in version 1.4.x, with the default MVStore storage engine. It is disabled by default when using the default PageStore storage engine in version 1.3.x.
Data Model
H2 is a traditional database management system built based on the relational model of data.
Indexes[09][10]
H2 uses Hash Table and AVL-Tree indexes for in-memory tables, and B-Tree indexes for disk-based tables. Indexes are created automatically for primary key and unique constraints. Multi-dimensional indexes is supported in H2. An algorithm called "bit-interleaving", which maps the multi-dimensional key to a single dimensional value on a space-filling curve, is implemented to execute multi-dimension (spatial) range queries efficiently.
Isolation Levels[11]
H2 supports three isolation levels for all data manipulation language (DML) statements: Read Committed, Read Uncommitted and Serializable. The default level is "Read Committed" in most cases. Table level locking is used to make sure all connections only see consistent data. When MVCC is enabled (default setting in version 1.4.x when using the MVStore), instead of table level locking, rows are locked for update and "Read Committed" is used in all cases.
System Architecture[12]
In embedded mode, H2 database can be embedded into an application and runs inside the same JVM using JDBC driver. In the server mode, H2 database is opened remotely using the JDBC driver or ODBC API, and all data is transferred over TCP/IP.
Views
H2 supports read only views and inline views. When using "instead of" triggers, views are updatable.
Citations
12 sources- http://www.h2database.com h2database.com
- GitHub - h2database/h2database: H2 is an embeddable RDBMS written in Java. · GitHub github.com
- Quickstart h2database.com
- H2 Database Engine - Wikipedia wikipedia.org
- H2 Database Engine h2database.com
- History h2database.com
- jOOQ Tuesdays: Thomas Müller Unveils How HSQLDB Evolved into the Popular H2 Database – Java, SQL and jOOQ. jooq.org
- Advanced h2database.com
- Performance h2database.com
- Features h2database.com
- Advanced h2database.com
- Features h2database.com