Strings
A string is a binary-safe byte sequence, not necessarily text. Use it for serialized records, cache entries, exact integer counters, or the backing bytes of bitmaps/bitfields. Keys are binary-safe too.
Write, read, and count
Section titled “Write, read, and count”target/release/ffkv-cli -p 6382 SET docs:string:greeting 'hello ffkv'target/release/ffkv-cli -p 6382 GET docs:string:greetingtarget/release/ffkv-cli -p 6382 APPEND docs:string:greeting '!'target/release/ffkv-cli -p 6382 STRLEN docs:string:greetingtarget/release/ffkv-cli -p 6382 SET docs:string:counter 41target/release/ffkv-cli -p 6382 INCR docs:string:countertarget/release/ffkv-cli -p 6382 MSET docs:string:first one docs:string:second twotarget/release/ffkv-cli -p 6382 MGET docs:string:first docs:string:secondINCR returns 42 here. Integer arithmetic is atomic and rejects non-integers/out-of-range results without changing the value. GETRANGE/SETRANGE address byte ranges, not Unicode characters. MSET/MGET coordinate their keys atomically across shards; MGET returns null for missing or non-string keys.
Conditions and expiry
Section titled “Conditions and expiry”target/release/ffkv-cli -p 6382 SET docs:string:cache fresh PX 60000 NXtarget/release/ffkv-cli -p 6382 SET docs:string:cache refreshed XX KEEPTTLtarget/release/ffkv-cli -p 6382 PTTL docs:string:cachetarget/release/ffkv-cli -p 6382 GETDEL docs:string:cacheSET supports NX/XX, GET, and one expiry mode: EX, PX, EXAT, PXAT, or KEEPTTL. Ordinary SET/MSET clears an old TTL; arithmetic preserves it. A failed condition changes neither value nor TTL. SET with GET returns the previous value even if NX prevents a write. GETEX changes expiration while reading; GETDEL removes while returning the value.
SET may replace another type, but SET GET on a list fails WRONGTYPE without replacing it. GET/arithmetic reject incompatible types. An expiration deadline uses wall-clock time, including downtime; TTL/PTTL distinguish persistent (-1) and missing (-2) keys.
Limits, bytes, and durability
Section titled “Limits, bytes, and durability”Stored strings/bitmap writes cap at 8 MiB, and the 8 MiB request budget includes framing, so a single maximum-size value may be rejected earlier. Use -x for NUL-containing payloads:
printf 'a\000b' | target/release/ffkv-cli -p 6382 -x SET docs:string:binarytarget/release/ffkv-cli -p 6382 --json GET docs:string:binaryString values remain RAM-resident in hybrid mode. They recover only when persistence is enabled; a lost reply to INCR is ambiguous and must not trigger blind replay. Read CLI binary I/O, persistence, SET reference, and bitfields.