Skip to content

Configuration

Redlite is designed for zero-configuration operation. However, there are a few options available.

ArgumentShortDefaultDescription
--db-dredlite.dbDatabase file path
--addr-a127.0.0.1:6767Listen address and port
Terminal window
# Persistent file
./redlite --db=/var/lib/redlite/data.db
# In-memory (no persistence)
./redlite --db=:memory:
Terminal window
# Localhost only (default, secure)
./redlite --addr=127.0.0.1:6767
# All interfaces (for remote access)
./redlite --addr=0.0.0.0:6767
# Custom port
./redlite --addr=127.0.0.1:6379

When using Redlite as an embedded library, configuration is done through code:

use redlite::Db;
// Persistent database
let db = Db::open("/path/to/data.db")?;
// In-memory database
let db = Db::open_memory()?;
// Select database (0-15)
db.select(1)?;

Redlite configures SQLite with sensible defaults:

SettingValuePurpose
journal_modeWALConcurrent reads, better performance
synchronousNORMALBalance of safety and speed
foreign_keysONEnforce referential integrity
busy_timeout5000msWait for locks before failing

These settings are applied automatically when opening a database and cannot currently be changed.

Currently, Redlite does not use environment variables. All configuration is done via command line arguments or programmatically.

Redlite uses the tracing crate for logging. Configure with standard Rust logging environment variables:

Terminal window
# Enable info logging
RUST_LOG=info ./redlite --db=mydata.db
# Debug logging
RUST_LOG=debug ./redlite --db=mydata.db
# Trace logging (very verbose)
RUST_LOG=trace ./redlite --db=mydata.db
LimitValue
Max databases16 (0-15)
Max key size~1GB (SQLite blob limit)
Max value size~1GB (SQLite blob limit)
Max database size~281TB (SQLite limit)

In practice, you’ll hit disk space limits long before SQLite limits.