You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sis.apache.org by Martin Desruisseaux via dev <de...@sis.apache.org> on 2026/08/15 12:33:29 UTC

Migrate from Derby to HSQL or H2?

Hello all

Since Apache Derby has been retired, Apache SIS will need to migrate to 
another database for embedded EPSG data [1]. Two possibilities are HSQL 
or H2. A comparison on the H2 web site [2] suggests that H2 is generally 
faster, but this is not necessarily the primary concern for EPSG data. 
H2 seems to consume more memory than Derby but less than HSQL. The JAR 
file size of H2 (2.6 Mb) is larger than HSQL (1.6 Mb), but still smaller 
than Derby (3.4 Mb). The support of ANSI SQL is sufficient for SIS 
needs in all those databases. Tables are persisted on disk by default in 
H2 while they tables are in-memory by default in HSQL. While HSQL can be 
configured, the default behavior of H2 is more conform to SIS needs.

Is there any opinion about what should be the replacement for Derby in 
Apache SIS? I would like this change to be done for the next SIS 
release, tentatively in the next 2 weeks. If hearing no opinion, I'm 
inclined toward H2.

     Martin

[1]https://issues.apache.org/jira/browse/SIS-631
[2]https://www.h2database.com/html/performance.html

Re: Migrate from Derby to HSQL or H2?

Posted by Martin Desruisseaux via dev <de...@sis.apache.org>.
Le 24/08/2026 à 09:05, Johann Sorel via dev a écrit :

> Maybe some other databases could be used ?
>
> Like SQLite, which is used in the Geopackage format, so this driver 
> will be present in SIS if we use the incubator module anyway. 

But SQLite requires a native library, isn't it?

Maybe we can start with HSQLDB for now and revisit later. Three tickets 
have been created in their issues tracker [1][2][3]. The comments said 
that [1] and [2] will be fixed soon. [3] has been rejected, but if [2] 
is fixed we can live with that workaround.

     Martin

[1]https://sourceforge.net/p/hsqldb/bugs/1752/
[2]https://sourceforge.net/p/hsqldb/bugs/1753/
[3]https://sourceforge.net/p/hsqldb/bugs/1754/

Re: Migrate from Derby to HSQL or H2?

Posted by Johann Sorel via dev <de...@sis.apache.org>.
Hello,

Maybe some other databases could be used ?

Like SQLite, which is used in the Geopackage format, so this driver will 
be present in SIS if we use the incubator module anyway.


Johann Sorel


Le 18/08/2026 à 19:49, Martin Desruisseaux via dev a écrit :
> Hello all
>
> While I initially though to replace Derby by H2, I changed my mind and 
> propose HSQLDB at least for the next SIS version. The reasons are:
>
>  * HSQLDB license (BSD-like) more compatible with Apache than H2
>    licenses (category B).
>  * HSQLDB depends only on Java modules that we already use, except one:
>      o java.desktop (I wonder why, but SIS uses it too anyway)
>      o java.logging
>      o java.naming
>      o java.sql
>      o java.xml
>      o jdk.unsupported — this one is a problem, see below
>  * H2 adds more dependencies:
>      o java.management
>      o jdk.unsupported
>      o OSGI (not sure if optional or mandatory)
>      o java.scripting (optional)
>      o java.compiler (optional)
>      o javax.servlet (optional)
>      o jakarta.servlet (optional)
>      o JTS 1.17 (optional, but SIS uses JTS 1.20)
>      o Apache Lucene (optional)
>      o SLF4J (optional)
>  * HSQLDB support collation directly, while H2 documentation gives the
>    impression that is needs an additional dependency (ICU4J).
>  * HSQLDB has a `module-info.class` file while H2 does not.
>  * HSQLDB has more tests than H2 in Apache SIS code base.
>
> The JTS dependency may be a risk of conflict if SIS does not use the 
> same version as H2. The biggest issue that I see with HSQLDB it its 
> usage of `jdk.unsupported`. This issue has been reported to their bug 
> tracker [1][2].
>
>     Martin
>
> [1]https://sourceforge.net/p/hsqldb/bugs/1752/
> [2]https://sourceforge.net/p/hsqldb/feature-requests/376/
>


Re: Migrate from Derby to HSQL or H2?

Posted by Martin Desruisseaux via dev <de...@sis.apache.org>.
Hello all

While I initially though to replace Derby by H2, I changed my mind and 
propose HSQLDB at least for the next SIS version. The reasons are:

  * HSQLDB license (BSD-like) more compatible with Apache than H2
    licenses (category B).
  * HSQLDB depends only on Java modules that we already use, except one:
      o java.desktop (I wonder why, but SIS uses it too anyway)
      o java.logging
      o java.naming
      o java.sql
      o java.xml
      o jdk.unsupported — this one is a problem, see below
  * H2 adds more dependencies:
      o java.management
      o jdk.unsupported
      o OSGI (not sure if optional or mandatory)
      o java.scripting (optional)
      o java.compiler (optional)
      o javax.servlet (optional)
      o jakarta.servlet (optional)
      o JTS 1.17 (optional, but SIS uses JTS 1.20)
      o Apache Lucene (optional)
      o SLF4J (optional)
  * HSQLDB support collation directly, while H2 documentation gives the
    impression that is needs an additional dependency (ICU4J).
  * HSQLDB has a `module-info.class` file while H2 does not.
  * HSQLDB has more tests than H2 in Apache SIS code base.

The JTS dependency may be a risk of conflict if SIS does not use the 
same version as H2. The biggest issue that I see with HSQLDB it its 
usage of `jdk.unsupported`. This issue has been reported to their bug 
tracker [1][2].

     Martin

[1]https://sourceforge.net/p/hsqldb/bugs/1752/
[2]https://sourceforge.net/p/hsqldb/feature-requests/376/