Skip to content

Storage

Seerflow uses Protocol-based storage interfaces. Backends are swappable via a single config line:

storage:
backend: sqlite # or postgresql

Zero-config storage with WAL mode for concurrent reads during writes.

  • Auto-created on first run (~/.local/share/seerflow/seerflow.db)
  • WAL mode with optimized PRAGMAs (64 MiB cache, 256 MiB mmap)
  • FTS5 full-text search on log messages
  • Batch writes via WriteBuffer (1000 events or 100ms)
  • ~30K events/sec batched write throughput

Four tables created automatically:

  • events — indexed columns + msgpack BLOB
  • entity_events — junction table for entity-to-event queries
  • alerts — with dedup key UNIQUE index
  • model_state — key-value store for ML model checkpoints
storage:
backend: sqlite
data_dir: ~/.local/share/seerflow # default
sqlite_path: /custom/path/seerflow.db # override

For production deployments with higher concurrency requirements.

storage:
backend: postgresql
postgresql_url: ${DATABASE_URL:-postgresql://localhost/seerflow}

PostgreSQL backend is planned for Sprint 13.