HSQLDB (''Hyper SQL Database'') is a
relational database management system
A relational database is a (most commonly digital) database based on the relational model of data, as proposed by E. F. Codd in 1970. A system used to maintain relational databases is a relational database management system (RDBMS). Many relatio ...
written in
Java. It has a
JDBC driver and supports a large subset of
SQL-92,
SQL:2008,
SQL:2011, and
SQL:2016 standards. It offers a fast, small (around 1300 kilobytes in version 2.2)
database engine which offers both
in-memory
An in-memory database (IMDB, or main memory database system (MMDB) or memory resident database) is a database management system that primarily relies on main memory for computer data storage. It is contrasted with database management systems that e ...
and disk-based tables. Both embedded and server modes are available.
Additionally, it includes tools such as a minimal
Web server
A web server is computer software and underlying hardware that accepts requests via HTTP (the network protocol created to distribute web content) or its secure variant HTTPS. A user agent, commonly a web browser or web crawler, initiate ...
, command line and GUI management tools (can be run as applets), and a number of demonstration examples. It can run on Java runtimes from version 1.1 upwards, including
free Java implementations such as
Kaffe
Kaffe is a discontinued "clean room design" (reverse engineering) version of a Java Virtual Machine. It comes with a subset of the Java Platform, Standard Edition (Java SE), Java API, and tools needed to provide a Java runtime environment. Like m ...
.
HSQLDB is available under a
BSD license. It is used as a database and persistence engine in many
open source
Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use the source code, design documents, or content of the product. The open-source model is a decentralized sof ...
software projects, such as descendants of
OpenOffice.org Base
OpenOffice.org (OOo), commonly known as OpenOffice, is a discontinued open-source office suite. Active successor projects include LibreOffice (the most actively developed), Apache OpenOffice, Collabora Online (enterprise ready LibreOffice ...
(i.e.,
Apache OpenOffice Base
The Apache () are a group of culturally related Native American tribes in the Southwestern United States, which include the Chiricahua, Jicarilla, Lipan, Mescalero, MimbreƱo, Ndendahe (Bedonkohe or Mogollon and Nednhi or CarrizaleƱo an ...
,
LibreOffice Base, etc.), and the
Jitsi
Jitsi is a collection of free and open-source multiplatform voice (VoIP), video conferencing and instant messaging applications for the web platform, Windows, Linux, macOS, iOS and Android. The Jitsi project began with the Jitsi Desktop (previous ...
VoIP and video-conference client since version 2.6. It is also used in commercial products, such as
Mathematica
Wolfram Mathematica is a software system with built-in libraries for several areas of technical computing that allow machine learning, statistics, symbolic computation, data manipulation, network analysis, time series analysis, NLP, optimizat ...
and InstallAnywhere (starting with version 8.0).
Transaction support
HSQLDB version 2.0 has three transaction control modes. It supports with table level locks or with
multiversion concurrency control (MVCC), or a combination of locks and MVCC. version 1.8.1 supports
transaction isolation
In database systems, isolation determines how transaction integrity is visible to other users and systems.
A lower isolation level increases the ability of many users to access the same data at the same time, but increases the number of concurre ...
level 0 (read uncommitted) only.
Data storage
HSQLDB has two main table types used for durable read-write data storage, i.e., if a transaction has been successfully committed, it is guaranteed that the data will survive system failure and will keep their integrity.
The default MEMORY type stores all data changes to the disk in the form of a
SQL script. During engine start-up, these commands are executed and data are reconstructed into the memory.
Another table type is CACHED, which allows one to store more data, at the cost of the slower performance. The HSQLDB engine loads them only partially and synchronizes the data to the disk on transaction commits. However, the engine always loads all rows affected during an update into the memory. This renders very large updates impossible without splitting the work into smaller parts.
Other table types allow access to
comma-separated values (CSV) files. These tables can participate, for example, in queries with JOINs and simplify spreadsheet processing and read-write non-durable in-memory data storage.
SQL features
HSQLDB 2.0 supports all the core features and many optional features of
SQL:2008. Advanced features include user-defined SQL procedures and functions, schemas, datetime intervals, updatable views, arrays, lobs, full and lateral joins and
set operations. Many non-standard functions such as TO_CHAR and DECODE are also supported. Extensions to standard SQL include user-defined
aggregate functions.
Releases
Several versions of HSQLDB have been released since 2001. Early versions were based on the discontinued HypersonicSQL database engine. Version 2.0, released in 2010, is mostly new code, written to conform to Standard
SQL and
JDBC 4 Specification.
Version 2.3.2 (released in 2014) is fully multi-threaded and supports high performance
two-phase locking
In databases and transaction processing, two-phase locking (2PL) is a concurrency control method that guarantees serializability.Phil Bernstein, Philip A. Bernstein, Vassos Hadzilacos, Nathan Goodman (1987) ''Concurrency Control and Recovery in Dat ...
and
MVCC (multiversion concurrency control) transaction control models.
See also
*
List of relational database management systems
*
Comparison of relational database management systems
*
Apache Derby
Apache Derby (previously distributed as IBM Cloudscape) is a relational database management system (RDBMS) developed by the Apache Software Foundation that can be embedded in Java programs and used for online transaction processing. It has a 3.5 ...
*
H2
References
External links
*{{official website
Free database management systems
Java platform software
SQL
Relational database management systems
Relational database management software for Linux
Software using the BSD license
Embedded databases
Database engines