SQLite, introduced at Version 3.8.1, is being considered as a potential replacement for H2 in the future. Like H2, SQLite is a file-based database. The advantage of SQLite is its minimal setup requirement; no additional installation of a database server or dependencies is necessary. Additionally, SQLite tends to be faster than MariaDB and Postgres, and its backup process is implicit since it involves only a single file.
However, there are some important considerations when using SQLite.
An example configuration is provided here
In the simplest case, configuring the database file name in the node.properties
file is sufficient. No username or password is required.
DB.Url=jdbc:sqlite:file:./db/signum.sqlite.db
DB.Username=
DB.Password=
Testnet is primarily for slightly advanced users, providing an environment to experiment without using real SIGNA. Users can obtain "play money" (TSIGNA) from the community. To switch to testnet, simply change the database file name:
# Tell Signum Node to use Testnet
node.network = signum.net.TestnetNetwork
DB.Url=jdbc:sqlite:file:./db/signum-testnet.sqlite.db
DB.Username=
DB.Password=
Setting DB.Optimize=true
triggers optimization processes on node startup. Defragmentation (via VACUUM
) may take several minutes, so patience is required.
It's highly recommended to use "WAL" mode during syncing. SQLite supports various journal modes, but WAL mode typically offers better performance.
## Possible Values are: DELETE,TRUNCATE,PERSIST,WAL (default, recommended)
DB.SqliteJournalMode = WAL
Note: MEMORY
journal mode is not supported.
Occasionally, SQL_BUSY
or SQL_BUSY_SNAPSHOT
exceptions may occur due to SQLite's single-writer nature. These errors typically don't cause consistency issues or affect synchronization but should be treated as warnings.
Running the VACUUM
command periodically is advisable to defragment the database and reduce file size. Ensure the node is shut down before running VACUUM
. This process can take several minutes to complete.
When setting properties value
DB.Optimize=on
, this command will be executed on each node start.
The default journaling mode, "Write-Ahead-Logging" (WAL), creates an additional .wal
file. During shutdown, a checkpoint is created to ensure data integrity. If using WAL mode, ensure both the .db
and .wal
files are copied together. Other journaling modes may be preferable if disk space is limited, though they may impact performance during syncing. The MEMORY
mode is not supported to prevent database corruption issues.