Storage
SQLite
Features of the SQLite storage engine for Nisshi:
- Reproduce an environment simply by copying a single DB file
- Deletion of messages older than retention.ms where the topic configuration cleanup.policy includes delete
- Compaction of duplicate message keys on topics having a cleanup.policy that includes compact
- Foreign key relationships are used to cascade deletion of topics and their associated metadata
- Prepared statements used by the broker are cached and reused by subsequent connections
- Single broker acting as the leader for any topic partitiion, transaction or consumer group
Enabled in the broker by using the --storage-engine=sqlite://nisshi.db parameter or setting the STORAGE_ENGINE environment variable.
Example
STORAGE_ENGINE=sqlite://nisshi.db
compose.yaml
An example compose.yaml with the broker using a volume mount for the SQLite database:
---
services:
nisshi:
image: ghcr.io/nisshi-io/nisshi
environment:
ADVERTISED_LISTENER_URL: tcp://nisshi:9092
RUST_BACKTRACE: 1
RUST_LOG: debug,nisshi_sans_io=warn,nisshi_model=warn
STORAGE_ENGINE: sqlite:///data/nisshi.db
volumes:
- ./data/:/data/