Configuration

MynaDB is configured via a config.toml file. If not present, default values are used. This guide explains all available options.

Complete Example

toml
# config.toml - MynaDB Configuration

[server]
http_port = 7000
flight_port = 7001

[storage]
data_dir = "/data0/stats/data"

[schema]
strategy = "service_as_schema"
tag_keys = ["MONITOR.service", "hierarchy_2", "service"]
default_name = "default"
prefix_numeric = true

[cache]
flush_interval_secs = 30

[compaction]
min_files = 4
max_level = 5
max_concurrent_compactions = 8
full_compaction_max_concurrent = 2

[retention]
enabled = true
default_days = 7
interval_secs = 3600
exclude_databases = ["_system"]

Server

Network and server settings.

[server]
http_port = 7000      # HTTP REST API port
flight_port = 7001    # Arrow Flight gRPC port
Option Type Default Description
http_port integer 7000 HTTP REST API port
flight_port integer 7001 Arrow Flight gRPC port

Storage

Data storage location.

[storage]
data_dir = "/data0/stats/data"    # Root directory for data
Option Type Default Description
data_dir string "./data" Root directory for Parquet files
⚠ Important

Ensure the data directory has sufficient disk space and appropriate permissions. Use SSD storage for best performance.

Schema

Controls how InfluxDB data maps to the catalog.schema.table structure.

[schema]
strategy = "service_as_schema"                         # or "service_as_table"
tag_keys = ["MONITOR.service", "hierarchy_2", "service"]
default_name = "default"
prefix_numeric = true
Option Type Default Description
strategy string "service_as_schema" Naming strategy (see below)
tag_keys array ["service"] Tag keys to extract service from
default_name string "default" Default schema/table name
prefix_numeric boolean true Prefix numeric values with "service_"

Strategy: service_as_schema

Example: cpu,service=web → mydb.web.cpu

Strategy: service_as_table

Example: cpu,service=web → mydb.default.web

Cache

In-memory write buffer settings.

[cache]
flush_interval_secs = 30    # Flush to disk every 30 seconds
Option Type Default Description
flush_interval_secs integer 30 Seconds between automatic flushes
💡 Tip

Lower values reduce data loss risk but increase I/O. Higher values improve write performance but increase memory usage.

Compaction

LSM-style compaction settings.

[compaction]
min_files = 4                          # Trigger when 4+ files at a level
max_level = 5                          # Maximum compaction level (L0-L5)
max_concurrent_compactions = 8         # Parallel LSM compactions
full_compaction_max_concurrent = 2     # Parallel full compactions
Option Type Default Description
min_files integer 4 Files needed to trigger compaction
max_level integer 5 Maximum compaction level
max_concurrent_compactions integer 8 Parallel LSM compactions
full_compaction_max_concurrent integer 2 Parallel full compactions (lower to avoid OOM)

Retention

Automatic data expiration settings.

[retention]
enabled = true                       # Enable background retention
default_days = 7                     # Delete data older than 7 days
interval_secs = 3600                 # Check every hour
exclude_databases = ["_system"]      # Skip these databases
exclude_tables = ["mydb.default.important"]  # Skip these tables
Option Type Default Description
enabled boolean true Enable automatic retention
default_days integer 7 Days to keep data
interval_secs integer 3600 Seconds between checks
exclude_databases array [] Databases to skip
exclude_tables array [] Tables to skip (catalog.schema.table)

OpenTelemetry (OTLP)

Native OpenTelemetry ingestion settings. See OTLP documentation.

[otlp]
enabled = false                      # Enable OTLP ingestion
grpc_port = 4317                     # OTLP gRPC port
http_enabled = true                  # Enable OTLP HTTP endpoints
metrics_database = "otel_metrics"    # Target database for metrics
logs_database = "otel_logs"          # Target database for logs
traces_database = "otel_traces"      # Target database for traces

Apache Iceberg

Iceberg REST Catalog API settings. See Iceberg documentation.

[iceberg]
enabled = false                      # Enable Iceberg REST Catalog
catalog_name = "mynadb"              # Catalog name exposed to engines
sync_interval_secs = 60             # Metadata sync interval
metadata_location = "data/iceberg"   # Iceberg metadata directory

Streaming Queries

Real-time query subscription settings. See streaming documentation.

[streaming]
enabled = false                      # Enable streaming queries
max_subscriptions = 100              # Max concurrent subscriptions
heartbeat_interval_secs = 30         # WebSocket heartbeat interval
buffer_size = 1000                   # Event buffer size per subscription

Continuous Aggregates

Materialized view and downsampling settings. See continuous aggregates documentation.

[continuous_aggregates]
enabled = false                      # Enable continuous aggregates
refresh_check_interval_secs = 60     # Check for refresh every 60s
max_concurrent_refreshes = 4         # Parallel refresh jobs
query_rewriting_enabled = true       # Auto-rewrite queries to use aggregates

TLS / SSL

Transport-layer security settings. See security documentation.

[tls]
enabled = false                      # Enable TLS
cert_file = "/etc/mynadb/tls/cert.pem"
key_file = "/etc/mynadb/tls/key.pem"
ca_file = "/etc/mynadb/tls/ca.pem"   # For mutual TLS (optional)
mutual_auth = false                  # Require client certificates

Audit Logging

Audit trail settings for compliance. See security documentation.

[audit]
enabled = false                      # Enable audit logging
log_file = "/var/log/mynadb/audit.log"
rotation = "daily"                   # "daily", "hourly", or "size"
max_files = 30                       # Rotated files to keep

Admin Console

Web-based admin interface settings. See admin console documentation.

[admin]
enabled = false                      # Enable admin console
port = 18080                         # Admin HTTP port
meta_endpoints = ["localhost:6001"]  # Meta service endpoints for cluster mode

Environment Variables

Configuration can also be set via environment variables:

export STATS_HTTP_PORT=7000
export STATS_FLIGHT_PORT=7001
export STATS_DATA_DIR=/data/stats

Configuration Precedence

  1. Environment variables (highest priority)
  2. config.toml file
  3. Default values (lowest priority)

Recommended Production Settings

toml
# Production config.toml

[server]
http_port = 7000
flight_port = 7001

[storage]
data_dir = "/data/stats"              # Use dedicated SSD

[cache]
flush_interval_secs = 30              # Balance durability/performance

[compaction]
min_files = 4
max_level = 5
max_concurrent_compactions = 4        # Adjust based on CPU cores
full_compaction_max_concurrent = 1    # Low to prevent OOM

[retention]
enabled = true
default_days = 30                     # 30 days retention
interval_secs = 3600                  # Check hourly

Next Steps