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.
vlog.writeAdmissionSERIALWrite admission mode: SERIAL, PREPARE_PARALLEL, or PARALLEL.
vlog.parallelWriteLanes0Parallel writer lane count; 0 chooses a bounded hardware-derived value when PARALLEL is used.
vlog.recoveryModeEAGERRecovery mode: EAGER or BACKGROUND.
vlog.codecNONEVersionLog value codec: NONE or ZSTD.
vlog.zstdCompressionLevel1Zstd level for new VersionLog records when codec = ZSTD.
vlog.segmentBytes64 MiBActive segment rotation size; 0 disables rotation.
vlog.retentionDays0Age boundary for pruning closed segments; 0 disables the age boundary.
vlog.retentionMinCommitSeq0Commit-sequence boundary for pruning closed segments; 0 disables the sequence boundary.

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

For examples and rollback behavior, see VersionLog Usage. For file format and recovery behavior, see VersionLog Architecture. For diagnostics and maintenance commands, see VersionLog Operations.

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.

For runtime role, replication mode, and startup examples, see Cluster Usage. For routing, replication flow, and wire format, see Cluster Architecture.

components.apiEnabled starts one or more server transports from api.backends. Keep this disabled when the process calls AkkEngine directly and does not expose a network boundary.

FieldMeaning
api.backendsServer backends to start: HTTP, TCP, gRPC, or a combination.
api.serverBackendPathOptional dynamic server-provider library path.
api.transportBackendPathOptional dynamic transport-provider library path.
api.httpBackendPathOptional HTTP backend implementation path.
api.tcpBackendPathOptional TCP backend implementation path.
api.grpcBackendPathOptional gRPC backend implementation path.

HTTP settings:

FieldMeaning
api.bindHostHost address used by API listeners.
api.httpPortHTTP listener port.
api.httpMaxBatchItemsMaximum items accepted in one HTTP batch.
api.httpMaxScanItemsMaximum scan rows returned per HTTP request.
api.httpMaxHistoryEntriesMaximum history entries returned per HTTP request.
api.httpMaxContentLengthMaximum HTTP request body size.

TCP settings:

FieldMeaning
api.tcpPortTCP listener port.
api.tcpIoBackendTCP I/O backend selection.
api.tcpWorkerThreadsTCP worker thread count; 0 means automatic behavior.
api.tcpAcceptQueueLimitMaximum accepted sockets waiting for workers.
api.tcpListenBacklogOS listen backlog.
api.tcpReadTimeoutMsRead timeout in milliseconds.
api.tcpWriteTimeoutMsWrite timeout in milliseconds.
api.tcpNoDelayEnables or disables Nagle avoidance.
api.tcpKeepAliveEnables or disables TCP keepalive.

gRPC settings:

FieldMeaning
api.grpcPortgRPC listener port.
api.grpcWorkerThreadsgRPC worker thread count.
api.grpcCompletionQueuesCompletion queue count.
api.grpcMinPollersMinimum poller count.
api.grpcMaxPollersMaximum poller count.
api.grpcMaxConcurrentStreamsHTTP/2 stream concurrency limit.
api.grpcResourceQuotaBytesgRPC resource quota in bytes.

TLS settings:

FieldMeaning
api.transportModeTLS or PLAIN.
api.tls.certPathServer certificate path.
api.tls.keyPathServer private key path.
api.tls.caPathCA bundle path for peer verification.
api.tls.pskPre-shared key bytes.
api.tls.pskIdentityPre-shared key identity.
api.tls.verifyPeerWhether peer verification is required.

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.

For startup examples and HTTP endpoints, see API Server Usage. For TCP framing and transport internals, see API Server Architecture.

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.