API Reference ferricstore v#0.3.1

Copy Markdown View Source

Modules

Module-based cache instances for FerricStore.

Elixir-native implementation of all FerricStore data-type operations, delegating to Router and command handlers.

Instance context for a FerricStore instance.

Per-instance supervision tree for a FerricStore instance.

Generates the full FerricStore public API (get, set, del, hash, set, list, sorted set, probabilistic, etc.) for use FerricStore modules.

Pipeline accumulator for batching multiple FerricStore commands.

Transaction accumulator for executing multiple FerricStore commands atomically.

OTP Application for the FerricStore core engine.

ETS-backed ring buffer that records security-relevant events.

Shard-by-shard data directory copy for new node sync.

Manages cluster membership: monitors node connections, orchestrates join/leave flows, and coordinates data sync for new followers.

Handles Redis bitmap commands: SETBIT, GETBIT, BITCOUNT, BITPOS, BITOP.

Parses and validates blocking list commands: BLPOP, BRPOP, BLMOVE, BLMPOP.

Handles Redis-compatible Bloom filter commands.

Count-Min Sketch commands routed through Raft for replication.

Central registry of all commands supported by FerricStore.

Handles FerricStore cluster inspection and management commands.

Handles Redis-compatible Cuckoo filter commands.

Routes Redis command names to the appropriate handler module.

Handles Redis expiry commands: EXPIRE, PEXPIRE, EXPIREAT, PEXPIREAT, TTL, PTTL, PERSIST.

Handles Redis generic key commands: TYPE, UNLINK, RENAME, RENAMENX, COPY, RANDOMKEY, SCAN, EXPIRETIME, PEXPIRETIME, OBJECT, WAIT.

Handles Redis geo commands: GEOADD, GEOPOS, GEODIST, GEOHASH, GEOSEARCH, GEOSEARCHSTORE.

Handles Redis hash commands: HSET, HGET, HDEL, HMGET, HGETALL, HLEN, HEXISTS, HKEYS, HVALS, HSETNX, HINCRBY, HINCRBYFLOAT, HEXPIRE, HTTL, HPERSIST, HSCAN, HRANDFIELD.

Handles Redis HyperLogLog commands: PFADD, PFCOUNT, PFMERGE.

Handles Redis JSON commands: JSON.SET, JSON.GET, JSON.DEL, JSON.NUMINCRBY, JSON.TYPE, JSON.STRLEN, JSON.OBJKEYS, JSON.OBJLEN, JSON.ARRAPPEND, JSON.ARRLEN, JSON.TOGGLE, JSON.CLEAR, JSON.MGET.

Handles Redis list commands using compound key storage.

Handles Redis MEMORY subcommands.

Handles the FERRICSTORE.CONFIG command for namespace-aware configuration.

Handles FerricStore-native commands that go beyond the Redis command set.

Handles Redis pub/sub commands that go through the normal dispatcher: PUBLISH, and PUBSUB (with subcommands CHANNELS, NUMSUB, NUMPAT).

Handles Redis server commands: PING, ECHO, DBSIZE, KEYS, FLUSHDB, FLUSHALL, INFO, COMMAND, SELECT, LOLWUT, and DEBUG.

Handles Redis set commands: SADD, SREM, SMEMBERS, SISMEMBER, SMISMEMBER, SCARD, SINTER, SUNION, SDIFF, SDIFFSTORE, SINTERSTORE, SUNIONSTORE, SINTERCARD, SRANDMEMBER, SPOP, SMOVE, SSCAN.

Handles Redis sorted set commands: ZADD, ZSCORE, ZRANK, ZRANGE, ZCARD, ZREM, ZINCRBY, ZCOUNT, ZPOPMIN, ZPOPMAX, ZRANGEBYSCORE, ZREVRANGE, ZSCAN, ZRANDMEMBER, ZMSCORE.

Handles Redis Stream commands: XADD, XLEN, XRANGE, XREVRANGE, XREAD, XTRIM, XDEL, XINFO STREAM, XGROUP CREATE, XREADGROUP, and XACK.

Handles Redis string commands.

Handles Redis-compatible TDIGEST.* commands.

Handles Top-K commands routed through Raft for replication.

GenServer managing runtime configuration for FerricStore.

ETS-backed storage for node-local configuration parameters.

Mini-percolator for cross-shard multi-key operations.

Resolves stale intents left by crashed cross-shard operation coordinators.

Manages the FerricStore on-disk directory layout (spec section 2B.4).

Thin Elixir wrapper over Ferricstore.Bitcask.NIF.fs_* that

GenServer managing compute locks for cache-aside with stampede protection.

Linear-time binary glob matcher.

Hybrid Logical Clock (HLC) for FerricStore.

Tracks node readiness for Kubernetes health probes (spec 2C.1 Phase 3).

Pure-Elixir HyperLogLog probabilistic cardinality estimator.

Emits Redis-compatible keyspace and keyevent notifications via PubSub.

Memory pressure monitor and eviction controller for FerricStore.

Crash-safe manifest for in-progress merge operations.

Per-shard merge scheduler that triggers compaction when file rotation occurs.

Node-level semaphore that limits concurrent merge operations.

Supervises the merge subsystem: one Semaphore and N Scheduler processes.

Prometheus-compatible metrics exposition for FerricStore.

GenServer managing per-namespace (prefix) runtime configuration.

ETS-based Pub/Sub registry for FerricStore.

Instruments ra_file:sync/1 to collect timing data about WAL fsync calls.

Namespace-aware group commit batcher for a single FerricStore shard.

Manages the ra Raft cluster for FerricStore shards.

Ra state machine for a single FerricStore shard.

ETS-backed ring buffer that records commands whose execution time exceeds a configurable threshold.

Tracks global server statistics using :counters for lock-free atomic increments.

Tracks the active log file for each shard.

Per-shard background fsync for Bitcask data files.

Background Bitcask writer for deferred persistence of small values.

Encodes and decodes compound keys for data structure storage in Bitcask.

Per-shard atomic disk pressure flags.

LFU (Least Frequently Used) counter with time-based decay, matching Redis's implementation.

Pure-logic module for list data structure operations.

Transaction-local store context for MULTI/EXEC.

Unified interface for store operations.

Collection promotion: migrates large compound-key collections from the shared shard Bitcask into a dedicated per-key Bitcask instance.

Per-shard fallback for async read-modify-write (RMW) commands under contention.

Routes keys to shard GenServers using consistent hashing via :erlang.phash2/2.

GenServer managing one Bitcask partition backed by an ETS hot-read cache.

Compound-key CRUD, prefix scan/count, promoted-collection dedicated storage, and automatic compaction.

ETS keydir operations: lookup, insert, delete, cold-read warming, LFU touch, hot-cache threshold enforcement, and prefix scans.

Async and sync Bitcask batch flush, file rotation, hint-file writing, and per-file dead-byte fragmentation tracking.

Shard startup (log/hint recovery, keydir rebuild), expiry sweep, probabilistic-file migration, Raft init, and graceful shutdown.

Shard-level CAS, distributed lock, rate-limit, and list operation handlers with Raft and direct-write paths.

Shard read-path handlers: ETS hot lookup, cold-key pread from Bitcask, exists check, and key enumeration.

Executes a queued MULTI/EXEC command batch inside a shard using a local transaction store.

Shard write-path handlers: put, delete, incr, append, getset, getdel, getex, and setrange with async flush and Raft support.

Manages the 1,024-slot to shard-index mapping.

Manages type metadata for Redis keys that hold data structures.

Shared helpers for parsing, formatting, and encoding values.

Per-shard atomic write version counters for WATCH/EXEC support.

Pure functional t-digest data structure for accurate on-line accumulation of rank-based statistics such as quantiles, trimmed means, and cumulative distribution values.

Transaction coordinator for MULTI/EXEC.

BEAM waiter registry for blocking list commands (BLPOP, BRPOP, BLMOVE, BLMPOP).

Mix Tasks

Mix compiler task that builds the patched ra_log_wal.erl to .beam for WAL write optimizations.

Manages FerricStore namespace configuration from the command line.

Displays FerricStore node status including uptime, shard count, key count, memory usage, and Raft consensus status.

Lists keys stored in FerricStore, with optional glob pattern filtering.

Triggers a manual merge/compaction check on one or all FerricStore shards.