Frequently Asked Questions
Common questions about MynaDB, its features, and best practices for time series data management.
General
What is MynaDB?
MynaDB is a high-performance time series database written in Rust. It ingests data via InfluxDB Line Protocol, stores it in Apache Parquet format, and provides SQL queries through Apache DataFusion. It's designed for metrics, monitoring, and analytics workloads.
Is MynaDB compatible with InfluxDB?
MynaDB uses InfluxDB Line Protocol for data ingestion, making it compatible with many existing InfluxDB clients and tools. However, the query interface uses SQL instead of InfluxQL or Flux, providing more flexibility and familiarity for most users.
What are the system requirements?
MynaDB runs on Linux, macOS, and Windows with minimal requirements:
- CPU: 2+ cores recommended
- Memory: 512MB minimum, 2GB+ recommended for production
- Disk: SSD recommended for best performance
- Rust: 1.70+ for building from source
Data & Storage
What storage format does MynaDB use?
MynaDB stores data in Apache Parquet format, a columnar storage format optimized for analytical queries. Parquet provides excellent compression ratios and fast query performance for time series data.
How is data partitioned?
Data is partitioned by date (date=YYYY-MM-DD) within each table. This enables
efficient time-range queries and simple retention management by deleting entire date partitions.
What's the difference between ServiceAsSchema and ServiceAsTable?
| Strategy | Schema | Table | Best For |
|---|---|---|---|
ServiceAsSchema |
Service tag value | Measurement name | Multiple measurements per service |
ServiceAsTable |
Fixed "default" | Service tag value | Service-centric querying |
How long is data retained?
Retention is configurable. By default, data is retained for 7 days. You can adjust this
in config.toml or manually trigger retention via the API:
# config.toml
[retention]
enabled = true
default_days = 30 # Keep data for 30 days
Queries
What query language does MynaDB support?
MynaDB supports standard SQL via Apache DataFusion. This includes SELECT, WHERE, GROUP BY, ORDER BY, JOIN, and aggregate functions. See the SQL Queries guide for details.
Why do I need to call /flush before querying new data?
MynaDB buffers incoming data in memory for performance. Data is periodically flushed
to disk (default: every 30 seconds). Call /flush to immediately persist buffered
data if you need to query it right away.
# Force flush before querying
curl -X POST http://localhost:7000/flush
curl 'http://localhost:7000/query/mydb' -d 'SELECT * FROM cpu LIMIT 10'
How do I query across multiple tables?
Use standard SQL JOINs:
SELECT c.host, c.usage, m.available
FROM cpu c
JOIN memory m ON c.host = m.host AND c.time = m.time
WHERE c.time > now() - INTERVAL '1 hour'
What's the timestamp format?
Timestamps are stored as nanoseconds since Unix epoch (19-digit integers). When writing data, you can omit the timestamp and the server will use the current time.
Performance
How can I improve query performance?
- Use LIMIT: Always add LIMIT for exploratory queries
- Filter on time: Time-based filters leverage partitioning
- Run compaction: Reduces file count and improves scan efficiency
- Use Arrow Flight: Faster than HTTP for large result sets
How can I improve write performance?
- Batch writes: Send multiple points per request
- Increase flush interval: Reduce disk I/O frequency
- Use SSD storage: Faster writes and compaction
What is compaction and when should I run it?
Compaction merges small Parquet files into larger ones, improving query performance and reducing storage overhead. MynaDB runs compaction automatically, but you can also trigger it manually:
# Compact all tables in a database
curl -X POST http://localhost:7000/compact/mydb
# Compact a specific table
curl -X POST http://localhost:7000/compact/mydb/cpu
API
What's the difference between HTTP API and Arrow Flight?
| Feature | HTTP API | Arrow Flight |
|---|---|---|
| Protocol | HTTP/JSON | gRPC/Arrow |
| Best for | Simple queries, writes | Large result sets |
| Streaming | No | Yes |
| Client support | Any HTTP client | Arrow Flight clients |
| Port | 7000 (default) | 7001 (default) |
Can I use DataFusion CLI with MynaDB?
Yes! MynaDB's Arrow Flight interface is compatible with DataFusion CLI:
datafusion-cli --host localhost --port 7001
Operations
How do I back up my data?
Since data is stored as Parquet files, you can back up the entire data_dir
directory. For consistency, either stop the service or call /flush before
backing up.
Can I run multiple MynaDB instances?
Yes, with High Availability mode. Configure a master-slave setup for replication and automatic failover. See the High Availability guide.
How do I monitor MynaDB?
Use the built-in endpoints:
# Health check
curl http://localhost:7000/health
# Cache and write statistics
curl http://localhost:7000/stats
# List tables
curl http://localhost:7000/tables/mydb
Migration
Can I migrate from InfluxDB?
Yes. Since MynaDB uses InfluxDB Line Protocol, you can export data from InfluxDB and replay it to MynaDB. Tools like Telegraf can write to both simultaneously during migration.
Can I import existing Parquet files?
Yes, place Parquet files in the appropriate directory structure
(data_dir/catalog/schema/table/date=YYYY-MM-DD/) and restart the service.
Ensure the schema matches the expected format.