Skip to main content
Version: 0.16

Data store

The data store holds email metadata, mailbox state, account settings, folders, and most configuration objects. It does not hold raw message bodies, Sieve scripts, or other large binary files; those are managed separately by the blob store so that each layer can be tuned independently.

Backend selection is made on the DataStore singleton (found in the WebUI under Settings › Storage › Data Store). The object is a multi-variant type: each instance selects one of several database backends, and the chosen variant determines which fields apply. The supported variants are:

  • RocksDB: a high-performance embedded key-value database, recommended for single-node installations.
  • FoundationDB: a distributed ACID database for clustered deployments, recommended for multi-node installations.
  • PostgreSQL: an object-relational database.
  • MySQL / MariaDB: a relational database management system.
  • SQLite: a self-contained, serverless, file-based database.

Configuration

To change the data store backend, update the DataStore singleton and select the variant for the desired backend. Each variant carries its own fields (for example, the RocksDB variant requires path, while the PostgreSQL variant requires host, database, authUsername, and authSecret). See the DataStore reference for the full field list per variant.

Maintenance

Scheduled clean-up of the data store is managed centrally through the DataRetention object (found in the WebUI under Settings › Storage › Data Retention › Archiving, Settings › Storage › Data Retention › Data Cleanup, Settings › Storage › Data Retention › Auto-Expunge, Settings › Storage › Data Retention › Telemetry). The dataCleanupSchedule field sets how often the data store clean-up task runs, using a cron expression. The default runs daily at 02:00. Related schedules include expungeSchedule for auto-expunge and blobCleanupSchedule for blob store clean-up.