This reference details all hard protocol limits in Slyber DB, engine and server settings in db.Config, daemon CLI flags and environment variables, and network client options in db.ClientConfig.
1. System Constants and Hard Limits
| Constant | Value | Description |
|---|---|---|
NumVirtualPartitions | 4096 | Total number of virtual partitions (0..4095) |
MaxKeyBytes | 8192 (8 KiB) | Maximum byte size of a user Key or Scan/Watch prefix |
MaxPartKeyBytes | 512 (512 B) | Maximum byte size of a partition colocation key (PartKey) |
MaxStreamKeyBytes | 512 (512 B) | Maximum byte size of a StreamKey |
MaxConsumerGroupBytes | 256 (256 B) | Maximum length of a consumerGroup name in CommitCursor / GetCursor |
MaxStreamHeaderBytes | 65536 (64 KiB) | Maximum byte size of a stream message Header |
InlineValueThreshold | 4096 (4 KiB) | KV separation threshold: values > 4 KiB are written to ValueLog / .slog |
MaxValueSizeLimit | 15 MiB | Upper ceiling for configurable MaxValueSize (4 KiB .. 15 MiB) |
MaxBatchOps | 10,000 | Maximum operations per Batch or Update transaction |
MaxBatchBytes | 16 MiB | Maximum total byte size of a single Batch, transaction, or WAL frame |
MaxFramePayloadBytes | 20 MiB | Hard wire-protocol frame ceiling for SLDB (OOM protection) |
Max2PCPartitions | 32 | Maximum distinct virtual partitions touched by one distributed Update transaction |
DefaultStreamLimit / Max | 100 / 10,000 | Default and maximum page size for ReadStream |
MinStrongSecretBytes | 32 bytes | Minimum secret length when RequireStrongSecrets: true (≥ 8 unique bytes) |
EncryptionKeyBytes | 32 bytes | AES-256-GCM key size (32 raw bytes or 64 hex characters) |
2. db.Config Struct Fields (Engine & Server)
Below are all db.Config fields with defaults from DefaultConfig(dataDir) and Validate() rules (applicable to both embedded and standalone modes):
db.Config Field | Default | Valid Range / Rules | Purpose |
|---|---|---|---|
DataDir | — (required) | Non-empty string | Root directory path for node storage |
Mode | ModeEmbedded | embedded, standalone, cluster | Runtime mode (StartServer promotes empty/embedded to standalone) |
NodeID | 1 | ≥ 1 in cluster mode | Unique 64-bit node identifier in a cluster |
SyncMode | SyncFull | SyncFull (0), SyncFastOS (1) | SyncFull: physical disk flush (fdatasync on Linux, F_FULLFSYNC on macOS); SyncFastOS: testing/staging mode |
NumLocalShards | 16 | Power of two in 1..64 | Number of physical local shards under data/shards/ |
NumReplicaGroups | 64 | Multiple of NumLocalShards, 1..4096 | Number of Multi-Raft replica groups |
WALSegmentBytes | 64 MiB | ≥ 256 KiB | Target size of a single wal_XXXXXX.log segment |
WALMaxBatchBytes | 4 MiB | 64 KiB .. WALSegmentBytes | Buffer size of one Group Commit pipeline arena |
MaxRetainedWALBytes | 512 MiB | ≥ WALSegmentBytes | Max retained WAL bytes per shard for lagging replicas before triggering InstallSnapshot |
MemTableSizeBytes | 32 MiB | 256 KiB .. 512 MiB | Flat MemTable arena size per shard |
BlockCacheBytes | 256 MiB | ≥ 1 MiB | Node-wide 64-sharded .sst block cache size |
SSTBlockBytes | 16 KiB | 4 KiB .. 256 KiB | Target uncompressed data block size inside .sst files |
VLogSegmentBytes | 128 MiB | ≥ 256 KiB | Target size of a single vlog_XXXXXX.dat segment |
StreamSegmentBytes | 64 MiB | ≥ 256 KiB | Target size of a stream data segment slog_*.dat before sealing |
StreamDedupCapacity | 4096 | 16 .. 1,000,000 | Per-stream persistent IdempKey deduplication ring capacity |
MaxValueSize | 4 MiB | 4 KiB .. 15 MiB | Maximum single KV value or stream Payload size |
WatchBufferSize | 256 | 16 .. 1,000,000 | Per-subscription event channel buffer capacity for Watch |
BallastSizeBytes | 64 MiB | ≥ 0 | Preallocated reserve.ballast file size |
DiskFreeMinBytes | 512 MiB | uint64 | Absolute free disk threshold for tripping ErrDiskFull |
DiskFreeMinPercent | 5.0 | 0.0 .. 95.0 | Percentage free disk threshold for tripping ErrDiskFull |
DiskCheckInterval | 2s | > 0 | Background statfs polling interval for DiskGuard |
MaxSnapshotLifetime | 5m | > 0 | Maximum lifetime of an open View or Scan snapshot (returns ErrSnapshotExpired on expiry) |
LockTTL | 10s | > 0 | Lease duration for 2PC KindTxLockIntent locks before zombie cleanup |
MaxClockDrift | 500ms | > 0 | Maximum tolerated HLC physical clock lead (exceeding returns ErrClockSkew) |
ListenAddr | ":9110" | host:port | Client SLDB binary wire protocol and /healthz listen address |
ClusterAddr | ":9111" | host:port | Inter-node Multi-Raft, 2PC, and migration listen address |
AdminAddr | ":9095" | host:port | Admin HTTPS API and Prometheus metrics listen address |
DefaultLanes | 8 | ≥ 1 | Recommended multiplexed connection lane count |
MaxTLSHandshakes | 64 | ≥ 1 | Concurrent TLS 1.3 handshake semaphore limit per node |
IPAllowlist | Private CIDRs | Non-empty in network modes | Allowed IPv4/IPv6 CIDR list (rejects unlisted IPs via immediate TCP RST before TLS) |
RequireStrongSecrets | false (SDK), true (CLI) | bool | Enforce ≥ 32-byte secret length and at least 8 distinct bytes |
ClientSecret / Fallback... | "" | Required in standalone/cluster | Primary and fallback client secrets (must differ from Admin/Cluster) |
AdminSecret / Fallback... | "" | Required in standalone/cluster | Primary and fallback Admin HTTPS API Bearer tokens |
ClusterSecret / Fallback... | "" | Required in cluster | Primary and fallback inter-node Multi-Raft secrets |
EncryptionKey / ...File | nil / "" | Mutually exclusive, 32B raw or 64 hex | Enables AES-256-GCM encryption at rest |
Default DefaultIPAllowlist() subnets: 127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10 (CGNAT / Tailscale / Mesh), 169.254.0.0/16, ::1/128, fc00::/7, and fe80::/10.
3. Daemon CLI Flags and Environment Variables
When both a CLI flag and an environment variable are set, the CLI flag takes precedence (used by both the systemd service and the Docker container):
| CLI Flag | Environment Variable | Default | Description |
|---|---|---|---|
--version | — | false | Print build version and exit with code 0 |
--healthcheck | — | "" | Probe HTTP/HTTPS /healthz URL and exit 0 (OK) or 1 (error) |
--healthcheck-timeout | — | 3s | Timeout for --healthcheck probe |
--healthcheck-insecure | — | false | Skip TLS certificate verification for non-loopback --healthcheck targets |
--mode | SLYBER_DB_MODE | standalone | Daemon mode: standalone or cluster |
--node-id | SLYBER_DB_NODE_ID | 1 | Unique node identifier (uint64) |
--data-dir | SLYBER_DB_DATA_DIR | ./data | Root data storage directory |
--addr | SLYBER_DB_ADDR | :9110 | Client SLDB bind address |
--cluster-addr | SLYBER_DB_CLUSTER_ADDR | :9111 | Inter-node Multi-Raft bind address |
--admin-addr | SLYBER_DB_ADMIN_ADDR | :9095 | Admin HTTPS API bind address |
--sync-mode | SLYBER_DB_SYNC_MODE | full | Disk durability mode: full or fast (fast-os) |
--shards | SLYBER_DB_SHARDS | 16 | Physical shard count (1..64, power of two) |
--groups | SLYBER_DB_GROUPS | 64 | Replica group count (multiple of --shards) |
--wal-segment-mb | SLYBER_DB_WAL_SEGMENT_MB | 64 | WAL segment size in MiB (auto-scales MaxRetainedWALBytes to ≥ 2 × WALSegmentBytes) |
--memtable-mb | SLYBER_DB_MEMTABLE_MB | 32 | Per-shard MemTable size in MiB |
--block-cache-mb | SLYBER_DB_BLOCK_CACHE_MB | 256 | Node-wide BlockCache size in MiB |
--ballast-mb | SLYBER_DB_BALLAST_MB | 64 | Size of reserve.ballast in MiB |
--disk-free-min-mb | SLYBER_DB_DISK_FREE_MIN_MB | 512 | Minimum free disk space in MiB |
--disk-free-min-pct | SLYBER_DB_DISK_FREE_MIN_PCT | 5.0 | Minimum free disk space percentage |
--max-tls-handshakes | SLYBER_DB_MAX_TLS_HANDSHAKES | 64 | Concurrent TLS handshake limit |
--allowlist | SLYBER_DB_ALLOWLIST | "" (private CIDRs) | Comma-separated allowed CIDR ranges |
--require-strong-secrets | SLYBER_DB_REQUIRE_STRONG_SECRETS | true | Enforce secret entropy and minimum 32-byte length |
--client-secret | SLYBER_DB_CLIENT_SECRET | "" | Primary client secret string |
--client-secret-file | SLYBER_DB_CLIENT_SECRET_FILE | "" | Path to file containing the client secret |
--fallback-client-secrets | SLYBER_DB_FALLBACK_CLIENT_SECRETS | "" | Comma-separated fallback client secrets |
--admin-secret | SLYBER_DB_ADMIN_SECRET | "" | Primary admin Bearer secret |
--admin-secret-file | SLYBER_DB_ADMIN_SECRET_FILE | "" | Path to file containing the admin secret |
--fallback-admin-secrets | SLYBER_DB_FALLBACK_ADMIN_SECRETS | "" | Comma-separated fallback admin secrets |
--cluster-secret | SLYBER_DB_CLUSTER_SECRET | "" | Primary inter-node cluster secret |
--cluster-secret-file | SLYBER_DB_CLUSTER_SECRET_FILE | "" | Path to file containing the cluster secret |
--fallback-cluster-secrets | SLYBER_DB_FALLBACK_CLUSTER_SECRETS | "" | Comma-separated fallback cluster secrets |
--encryption-key-file | SLYBER_DB_ENCRYPTION_KEY_FILE | "" | Path to AES-256-GCM key file (32 raw bytes or 64 hex chars) |
--shutdown-timeout | SLYBER_DB_SHUTDOWN_TIMEOUT | 15s | Graceful shutdown timeout on SIGINT/SIGTERM |
Daemon exit codes:
0— clean shutdown on signal,--versionoutput, or passing--healthcheck.1— failed--healthcheckprobe or error during graceful shutdown.2— configuration validation, secret validation, or CLI flag parsing error.
4. db.ClientConfig Struct Fields (Go Network Client)
db.ClientConfig Field | Default | Purpose |
|---|---|---|
Addrs | — (required) | Seed node addresses ([]string); in ModeCluster, a single live seed is enough for auto-discovery via OpClusterNodes |
ClientSecret | — (required) | Client secret for mutual TLS 1.3 EKM HMAC-SHA256 authentication |
AdminAddr | "" | Admin HTTPS address (host:9095) — required only when calling cli.Backup(...) or cli.Stats() |
AdminSecret | "" | Admin Bearer token for cli.Backup(...) and cli.Stats() |
Lanes | 8 | Number of persistent multiplexed TLS 1.3 lanes per node (≥ 1) |
DialTimeout | 5s | Timeout for establishing TCP + TLS 1.3 + OpAuth |
RequestTimeout | 15s | Default per-request timeout when ctx has no deadline |
MaxRetries | 3 | Network retry count for idempotent operations on connection drop |
MaxValueSize | 4 MiB | Client-side value limit (4 KiB .. 15 MiB; should match server Config.MaxValueSize) |
WatchBuffer | 256 | Local client-side event channel buffer size for Watcher |
LockTTL | 10s | LockExpiresAt lease applied by the client coordinator during distributed 2PC transactions |
TLSConfig / DialContext | Auto TLS 1.3 / net.Dialer | Custom TLS or network dialer configuration (e.g., proxy or corporate mTLS) |
Related Guides
- Partitioning and shard layout: Slyber DB Overview and Architecture
- Using
db.ClientConfigin Go: Go SDK: Client, Tuples, KV Operations, and ACID Transactions - Error codes and alerts: Day-2 Operations, Prometheus Monitoring, and Error Catalog