Skip to main content

Configuration Reference

Constructor Parameters​

The Apiary constructor accepts two parameters:

ParameterTypeDefaultDescription
namestr(required)Logical name for this apiary. Used as the root namespace and the default directory name for local storage.
storagestr | NoneNoneStorage URI. When None, uses local filesystem at ~/.apiary/data/{name}/.

Storage URI Formats​

FormatBackendExample
None / omittedLocal filesystemApiary("mydb") -- stores at ~/.apiary/data/mydb/
s3://bucket/pathAWS S3Apiary("prod", storage="s3://my-bucket/apiary")
s3://bucket/path?endpoint=http://host:portMinIO / S3-compatibleApiary("prod", storage="s3://[email protected]:9000")
note

Google Cloud Storage is supported via its S3-compatible endpoint. Use s3:// URIs with GCS HMAC credentials and AWS_ENDPOINT_URL=https://storage.googleapis.com. Native gs:// URIs are not supported in v1.


Environment Variables​

Storage Credentials​

VariableDescriptionUsed By
AWS_ACCESS_KEY_IDS3 access keyS3Backend, MinIO
AWS_SECRET_ACCESS_KEYS3 secret keyS3Backend, MinIO
AWS_ENDPOINT_URLCustom S3 endpoint (e.g., MinIO)S3Backend
AWS_REGIONAWS region (default: us-east-1)S3Backend
AWS_SESSION_TOKENTemporary session tokenS3Backend

Logging​

VariableDescriptionDefault
RUST_LOGLog level filter for the Rust runtimeinfo

Supported levels: error, warn, info, debug, trace. Module-level filtering is supported:

# General info, debug for query engine
RUST_LOG=info,apiary_query=debug

# Trace storage operations
RUST_LOG=info,apiary_storage=trace

Apiary Configuration​

VariableDescriptionDefault
APIARY_STORAGE_URLStorage URI for the node (e.g., s3://apiary/data)(set in Docker compose)
APIARY_NAMELogical name for this apiary instanceproduction
APIARY_IMAGEDocker image tag for Apiary containersapiary:latest
APIARY_VERSIONVersion to install via install scriptslatest
INSTALL_DIRCustom binary install location/usr/local/bin (Linux), $USERPROFILE\.apiary\bin (Windows)

Runtime Defaults​

Bee Pool​

ParameterDefaultDescription
Bee countAuto-detected CPU coresOne bee per virtual core
Memory budget per beeTotal RAM / core countEach bee gets an equal share of available memory
Task timeout30 secondsMaximum time a single task can run before termination
Scratch directorySystem temp dir / bee IDIsolated temp directory per bee for spill files

Cell Cache​

ParameterDefaultDescription
Cache size2 GBMaximum total size of cached cells on local disk
Eviction policyLRULeast recently used cells evicted first
Cache directory~/.apiary/{name}/_cache/Local directory for cached Parquet files

Heartbeat and Swarm​

ParameterDefaultDescription
Heartbeat interval5 secondsHow often each node writes its heartbeat file to storage
Suspect threshold15 secondsNode is marked suspect after missing this many seconds of heartbeats (derived: dead_threshold / 2)
Dead threshold30 secondsNode is marked dead after missing this many seconds of heartbeats
Stale cleanup60 secondsDead node heartbeat files are deleted after this duration

Colony Temperature​

RangeClassificationEffect
0.0 -- 0.3ColdSystem underutilized
0.3 -- 0.7IdealNormal operating range
0.7 -- 0.85WarmApproaching capacity (0.85 is classified as Warm)
> 0.85 -- 0.95HotTemperature reported to client (v2: write backpressure)
> 0.95CriticalTemperature reported to client (v2: query admission control)

Colony temperature is a composite metric derived from CPU utilization, memory pressure, and task queue depth.

Task Abandonment​

ParameterDefaultDescription
Max retries3Number of times a failed task is retried before permanent abandonment
Retry policyImmediateFailed tasks are re-queued immediately

Compaction​

Planned for v2

Automatic compaction is not implemented in v1. The following parameters describe the planned v2 compaction behavior. In v1, use overwrite_frame() to manually consolidate a frame's data.

ParameterDefaultDescription
Min cell count10Compact when a partition exceeds this number of cells
Small cell thresholdtarget_cell_size / 4Cells smaller than this are candidates for compaction
Max uncompacted age1 hourCompact cells older than this regardless of count

Leafcutter Cell Sizing​

ParameterDefaultDescription
Target cell sizememory_per_bee / 4Target size for new Parquet cells
Max cell sizetarget * 2Upper bound on cell size
Min cell size16 MBFloor to avoid excessive S3 per-request overhead