Skip to main content
The Edge Server stores all persistent data including database files, logs, and local state in a configurable directory. By default, this directory is created in the current working directory where the Edge Server is launched.

Configuring the Persistence Directory

You can specify a custom persistence directory in your database configuration:
database:
  db_id: "YOUR_APP_ID"
  device_name: "edge-device-1"
  persistence_dir:
    path: "/path/to/your/data"
  auth:
    # ... auth configuration
See the persistence directory configuration reference for more details.

Directory Structure

The persistence directory contains:
  • Database files: SQLite database files for each configured database
  • Logs: Debug-level logs saved in the ditto_logs subdirectory
  • Temporary files: Cache and temporary data used during synchronization

Docker Persistence

When running with Docker, mount a volume to persist data between container restarts:
docker run --rm -p 127.0.0.1:8080:8080 \
  -v ./quickstart_config.yaml:/config.yaml \
  -v ./data:/data \
  edge-server-quickstart:latest run -c /config.yaml
Then in your config file, set the persistence directory to the mounted path:
database:
  db_id: "YOUR_APP_ID"
  device_name: "edge-device-1"
  persistence_dir:
    path: "/data"
  auth:
    # ... auth configuration

Best Practices

  1. Use absolute paths: Always specify absolute paths for the persistence directory to avoid confusion about the working directory.
  2. Ensure write permissions: The Edge Server process must have write permissions to the specified directory.
  3. Separate data by instance: If running multiple Edge Server instances on the same machine, use different persistence directories for each.
  4. Monitor disk space: Database files and logs can grow over time, so monitor available disk space.