Skip to content

Low-Level API Options

akkaradb::engine::AkkEngineOptions controls the low-level engine shape before AkkEngine::open() creates or recovers an instance. Treat it as an immutable startup contract: after the engine is open, most component choices are fixed for that process.

The most common embedded setup only needs paths.dataDir and a few durability choices. The remaining fields are for storage tuning, protocol servers, cluster runtime wiring, or benchmark isolation.

akkaradb::engine::AkkEngineOptions opts;
opts.paths.dataDir = "data/akkaradb";
opts.wal.syncMode = akkaradb::engine::wal::WalSyncMode::ASYNC;
opts.runtime.sstPromoteReads = true;
auto db = akkaradb::engine::AkkEngine::open(std::move(opts));

When paths.dataDir is set, empty component paths are derived from it.

FieldDerived value
paths.walDir<dataDir>/wal
paths.blobDir<dataDir>/blobs
paths.sstDir<dataDir>/sstable
paths.manifestPath<dataDir>/manifest.akmf
paths.versionLogPath<dataDir>/history.akvlog
paths.clusterConfigPath<dataDir>/cluster.akcc
paths.nodeIdPath<dataDir>/node.id
FieldDefaultMeaning
components.walEnabledtrueEnables write-ahead logging for recovery and durability.
components.blobEnabledtrueEnables large-value offload through Blob storage.
components.manifestEnabledtrueTracks SST lifecycle and checkpoints.
components.sstEnabledtrueEnables persistent sorted-string-table storage.
components.versionLogEnabledfalseEnables history, point-in-time reads, and rollback.
components.clusterEnabledfalseEnables cluster routing and replication runtime.
components.apiEnabledfalseStarts configured API transports during engine startup.

For pure in-memory smoke tests, disable WAL, Blob, manifest, and SST. For real embedded storage, keep the defaults unless you are intentionally isolating a subsystem.

akkaradb::engine::AkkEngineOptions opts;
opts.components.walEnabled = false;
opts.components.blobEnabled = false;
opts.components.manifestEnabled = false;
opts.components.sstEnabled = false;
FieldDefaultMeaning
runtime.writerThreads0Reserved for writer parallelism; 0 means engine-selected behavior.
runtime.recoverWaltrueReplays WAL files on startup.
runtime.recoverSsttrueRecovers SST metadata and files on startup.
runtime.pruneWalOnFlushtrueRemoves WAL segments already covered by a durable flush checkpoint.
runtime.forceFlushOnClosetrueFlushes pending MemTable data when close() runs.
runtime.forceSyncOnClosetrueForces durable state to disk when close() runs.
runtime.sstPromoteReadsfalsePromotes SST hits back into MemTable to speed repeated reads.

sstPromoteReads is useful for read-heavy embedded workloads. Leave it off when you want read paths to avoid mutating in-memory state, such as storage-engine tests.

FieldDefaultMeaning
memtable.shardCount0Explicit shard count. 0 lets the engine choose.
memtable.expectedConcurrentWriters0Hint used for automatic shard sizing.
memtable.autoShardCountCap128Upper bound for automatic shard count.
memtable.thresholdBytesPerShard64 MiBApproximate per-shard flush threshold.
memtable.backendFactorynullptrOptional custom MemTable implementation factory.
memtable.onFlushnullptrInternal flush callback; applications normally leave this unset.

For write-heavy workloads, raise thresholdBytesPerShard to reduce flush frequency. For constrained memory environments, lower it and monitor stats.memtable.approxBytes.

FieldDefaultMeaning
wal.walDirderivedDirectory for WAL segments.
wal.syncModeSYNCDurability mode: SYNC, ASYNC, or OFF.
wal.shardCount0WAL shard count; 0 means one per hardware thread, capped internally.
wal.groupN128Max entries per grouped async flush.
wal.groupMicros100Max async flush delay in microseconds.
wal.groupBytes4 MiBMax bytes per grouped async flush.
wal.asyncMaxPendingBytes64 MiBBackpressure limit for pending async WAL data.

Use SYNC when every write should cross an fsync boundary before returning. Use ASYNC for higher throughput when a small durability window is acceptable. Use OFF only for temporary data or controlled benchmarks.

FieldDefaultMeaning
sst.sstDirderivedDirectory for SST files.
sst.maxLevels7Number of LSM levels.
sst.maxL0Files4L0 file count before compaction pressure rises.
sst.l1MaxBytes64 MiBLevel 1 size budget.
sst.levelSizeMultiplier10.0Size growth multiplier between levels.
sst.targetFileSizeengine defaultTarget SST file size.
sst.blockSizeengine defaultData block size inside SST files.
sst.bloomBitsPerKeyengine defaultBloom filter density.
sst.blockCacheBytes64 MiBSST block cache budget.
sst.compactThreads2Background compaction thread count.
sst.codecZSTDSST compression codec.

If L0 stalls appear in stats, increase compaction capacity or tune file sizes. If reads miss cache frequently, consider raising blockCacheBytes.

FieldDefaultMeaning
blob.blobDirderivedDirectory for Blob files.
blob.thresholdBytesengine defaultValues at or above this size are stored as blobs.
blob.codecNONEBlob compression codec.
blob.gcOnFlushfalseRuns Blob GC as part of flush activity.
blob.gcOnClosefalseRuns Blob GC when closing.

Blob storage keeps large values out of MemTable and SST payloads. Do not combine Blob GC with version-history assumptions unless you have verified old versions no longer need the blob files.

FieldDefaultMeaning
vlog.logPathderivedVersion log file path.
vlog.syncModeASYNCVersion log sync mode: SYNC, ASYNC, or BATCHED_SYNC.
vlog.groupN128Max entries per grouped flush.
vlog.groupMicros500Max grouped flush delay.
vlog.groupBytes1 MiBMax bytes per grouped flush.
vlog.asyncMaxPendingBytes64 MiBBackpressure limit for pending version-log data.

Enable components.versionLogEnabled before relying on history(), getAt(), rollbackKey(), or rollbackTo().

FieldDefaultMeaning
manifest.fastModefalseUses background batching for manifest durability work.
cluster.configemptyOptional durable cluster configuration.
cluster.runtimeBackendPathemptyDynamic runtime provider path.
cluster.runtimedefault runtimeRuntime-only replication transport options.

Cluster support is intentionally separate from the local embedded path. Keep components.clusterEnabled disabled until node identity, membership, transport mode, and acknowledgement policy are explicit.

components.apiEnabled starts one or more server transports from api.backends.

Field groupMain fields
Backend selectionapi.backends, api.serverBackendPath, api.httpBackendPath, api.tcpBackendPath, api.grpcBackendPath, api.transportBackendPath
HTTPapi.bindHost, api.httpPort, api.httpMaxBatchItems, api.httpMaxScanItems, api.httpMaxHistoryEntries, api.httpMaxContentLength
TCPapi.tcpPort, api.tcpIoBackend, api.tcpWorkerThreads, api.tcpAcceptQueueLimit, api.tcpListenBacklog, api.tcpReadTimeoutMs, api.tcpWriteTimeoutMs, api.tcpNoDelay, api.tcpKeepAlive
gRPCapi.grpcPort, api.grpcWorkerThreads, api.grpcCompletionQueues, api.grpcMinPollers, api.grpcMaxPollers, api.grpcMaxConcurrentStreams, api.grpcResourceQuotaBytes
TLSapi.transportMode, api.tls.certPath, api.tls.keyPath, api.tls.caPath, api.tls.psk, api.tls.pskIdentity, api.tls.verifyPeer

The API server is useful when AkkEngine is acting as a local process boundary or embedded service. Library users that call AkkEngine directly can leave it disabled.

Use caseImportant settings
Unit testDisable WAL, Blob, manifest, and SST.
Durable embedded DBSet paths.dataDir; keep WAL, manifest, and SST enabled.
Write throughputUse wal.syncMode = ASYNC; tune WAL group limits; monitor pending bytes.
Read-heavy cacheEnable runtime.sstPromoteReads; size SST block cache.
Time travelEnable components.versionLogEnabled; choose vlog.syncMode deliberately.
External serverEnable components.apiEnabled; configure backend limits and TLS.