Storage

SQLite

Features of the SQLite storage engine for Tansu:

  • 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://tansu.db parameter or setting the STORAGE_ENGINE environment variable.

Example

STORAGE_ENGINE=sqlite://tansu.db

compose.yaml

An example compose.yaml with the broker using a volume mount for the SQLite database:

---
services:
  tansu:
    image: ghcr.io/tansu-io/tansu
    environment:
      ADVERTISED_LISTENER_URL: tcp://tansu:9092
      RUST_BACKTRACE: 1
      RUST_LOG: debug,tansu_sans_io=warn,tansu_model=warn
      STORAGE_ENGINE: sqlite:///data/tansu.db
    volumes:
      - ./data/:/data/
Previous
PostgreSQL
Next
S3