KiviDB 1.3.0 aims to behave like Redis 8.10 for every command it implements; the commands Redis 8.12 adds are tracked in #1108. This page sums up where it stands and where it differs. The details are in other files:
- COMMANDS.md: every command, with its syntax.
- REDIS_8_4_TO_8_10_PARITY.md: each Redis 8.4–8.10 addition, and what isn't implemented.
- REDIS_TEST_SUITE.md: Redis's own test suite run against KiviDB, unit by unit, with what still fails and why.
- MIGRATING_FROM_REDIS.md: moving an application and its data.
| Area | Status |
|---|---|
| Protocol | RESP2 and RESP3 (HELLO). Redis clients, redis-cli and cluster-aware clients work unchanged. |
| Core data types | Strings, lists, sets, sorted sets, hashes (with per-field TTLs), streams and consumer groups, bitmaps, geo, Pub/Sub (including sharded). HyperLogLog, which reads Redis's encoding: see Differences. |
| Redis 8 data types | JSON, search and query (FT.*, full-text, tag, numeric and vector), time series (TS.*), vector sets (V*), Bloom filters (BF.*), Cuckoo filters (CF.*), Count-min sketches (CMS.*), Top-K (TOPK.*), t-digests (TDIGEST.*). All built in, nothing to load. |
| Transactions and scripts | MULTI/EXEC/WATCH and scripts run as one step, as in Redis (EXEC_ATOMICITY.md). Lua (EVAL, FUNCTION, FCALL) needs the lua or full build. |
| Security | AUTH, ACLs (users, key and channel patterns, ACL file), protected mode, TLS in the tls and full builds. |
| Persistence | Snapshots (dump.kdb, compressed with rdbcompression yes, which is off by default) and an append-only file. Reads a Redis dump.rdb. (PERSISTENCE.md) |
| Replication | REPLICAOF, partial resync, and replicating from a Redis primary. |
| Cluster | Redis's cluster protocol: hash slots, CLUSTER commands, gossip, failover, atomic slot migration. |
| Sentinel | No Sentinel of its own. Redis Sentinel manages KiviDB nodes: fails over, and redis-py, ioredis and Lettuce follow it (SENTINEL.md). |
| Modules | MODULE LOAD is not supported; the Redis 8 modules' commands are built in. |
- Redis's own test suite: REDIS_TEST_SUITE.md.
- Nine client libraries, over RESP2 and RESP3: redis-py, valkey-glide, ioredis, node-redis, Jedis,
Lettuce, go-redis, StackExchange.Redis and redis-rs send the same 99 commands to Redis 8.10 and to
KiviDB, and must get the same replies back, of the same kinds (a map, a set, a double), except for
the cases listed in
scripts/client_smoke/reported.json: valkey-glide 2.6 cannot read Redis 8's RESP3 search replies, and reads KiviDB's (search-resp3-reply auto). The Client smoke suite workflow runs it by hand, against a server built from the branch it is started on unless it is given an image; the clients are pinned to exact versions. - BullMQ's own test suite (its default config), on each release in the
compatibility workflow (
benchmarks/bullmq-compat/). - Sidekiq's own test suite, and kill-and-restart soaks of BullMQ and Sidekiq
(
scripts/client_compat/). - LiteLLM's caches (exact and semantic), router counters and proxy rate limiter (the
luabuild for the proxy), with LiteLLM's own Redis tests: benchmarks/litellm-compat/REPORT.md and docs/integrations/litellm.md. - LangChain's Redis integration (
langchain-redis): vector store, LLM and semantic cache, chat history: benchmarks/langchain-compat/REPORT.md and docs/integrations/langchain.md. - LangGraph's Redis checkpointer and store (
langgraph-checkpoint-redis): benchmarks/langgraph-compat/REPORT.md and docs/integrations/langgraph.md. - LlamaIndex's Redis vector store, document store, index store and key-value store: benchmarks/llamaindex-compat/REPORT.md and docs/integrations/llamaindex.md.
- RedisVL (
redisvl): SearchIndex create, load and query, including filters, SemanticCache, SemanticRouter andHybridQuery(FT.HYBRID, from the fix for #767); the default image is enough, no Lua: benchmarks/redisvl-compat/REPORT.md and docs/integrations/redisvl.md. - Mem0's Redis vector store and the
MemoryAPI on top of it, in the Python SDK and the TypeScript SDK (whose Valkey store works too): benchmarks/mem0-compat/REPORT.md, benchmarks/mem0-ts-compat/ and docs/integrations/mem0.md. - claude-mem's server job queue (BullMQ; the
luabuild): its own Docker E2E, and enqueue, retry, failure, cancel and restarts with real workers: benchmarks/claude-mem-compat/ and docs/integrations/claude-mem.md. - OpenViking's Redis parts (the
luabuild): its RAGFS cache runtime and PathLock tests, its gateway suite (standalone and cluster), and its expiry scheduler: benchmarks/openviking-compat/ and docs/integrations/openviking.md. - LightRAG's Redis KV and doc-status storages, with LightRAG's own contract suite: benchmarks/lightrag-compat/ and docs/integrations/lightrag.md.
- cognee's Redis cache (sessions, usage logs, the shared graph lock, which needs the
luabuild): benchmarks/cognee-compat/ and docs/integrations/cognee.md. - OmniRoute's rate limiter (a Lua script, so the
luabuild), auth cache, quota store, circuit breaker and semantic cache: benchmarks/omniroute-compat/ and docs/integrations/omniroute.md. - Dify's self-hosted stack (cache, Celery broker and result backend, pub/sub, locks; the
luabuild), end to end and with Dify's own Redis tests: benchmarks/dify-compat/ and docs/integrations/dify.md. - RAGFlow's self-hosted stack, end to end (the
luabuild): RAGFlow 1.0 in place of its Kvrocks service (secret key, agent-run lease, locks, media cache), with RAGFlow's own Go HTTP API suite, and RAGFlow 0.27 in place of its Valkey service (the stream task queue, cache and locks): benchmarks/ragflow-compat/ and docs/integrations/ragflow.md. - n8n's queue mode (Bull; the
luabuild) end to end, with worker and server restarts, and n8n's own Redis tests: benchmarks/n8n-compat/ and docs/integrations/n8n.md. - Self-hosted Firecrawl (BullMQ, crawl state, rate limits; the
luabuild) with its own test suite and its docker compose: benchmarks/firecrawl-compat/ and docs/integrations/firecrawl.md. - Celery and kombu (broker and result backend; the
luabuild), with their own Redis integration suites and a real worker through a SIGKILL and server restarts. Chords need the result backend on RESP2 on 1.2.0 (#431, fixed in 1.2.1): benchmarks/celery-compat/ and docs/integrations/celery.md. - Semantic Kernel's Redis vector store (Python; JSON and hash collections), with its own Redis tests: benchmarks/semantic-kernel-compat/ and docs/integrations/semantic-kernel.md.
- Spring AI's Redis vector store and chat memory repository (the
luabuild for chat memory), with its own Redis integration tests: benchmarks/spring-ai-compat/ and docs/integrations/spring-ai.md. - GPTCache's Redis scalar store, vector store and distributed eviction, with its own Redis tests: benchmarks/gptcache-compat/ and docs/integrations/gptcache.md.
@upstash/ratelimit2.0 through the Serverless Redis HTTP proxy (KiviDB has no REST API; theluabuild), with its own test suite: benchmarks/upstash-ratelimit-compat/ and docs/integrations/upstash-ratelimit.md.- valkey-glide (Python, Node.js, Java, Go):
FT.SEARCH,FT.AGGREGATE,FT.INFOand the commands around them, throughcustom_commandand GLIDE's own search API. GLIDE speaks RESP3 and converts these replies itself, from valkey-search's shape (the RESP2 layout on a RESP3 connection forFT.SEARCH,FT.AGGREGATE,FT.CURSOR READ,FT._LISTandFT.INFO, with its own forFT.HYBRID), so a connection that names itself GLIDE (CLIENT SETINFO LIB-NAME) is answered in that shape;search-resp3-reply valkeydoes it for every connection. A KNNWITHSCORESgives the distance where valkey-search gives 0;FT.INFOlists a vector field's dimensions in anindexlist, andFT.PROFILEis the array GLIDE converts, in that shape; the other search commands keep the Redis shape; an index that does not exist is named in valkey-search's words (Index with name '<name>' not found in database <n>) there and in Redis's elsewhere; the setting is per node, so in a cluster set every node alike: docs/CONFIGURATION.md. - From 1.3.0, Open WebUI's Valkey vector store (
VECTOR_DB=valkey, valkey-glide-sync), with its client unpatched: its ownValkeyClientthrough insert, search, filtered search, query, get, upsert, delete and reset, 17 checks, passing on KiviDB and on valkey/valkey-bundle 9.2.0.INFOreportsvalkey_version:9.0.1, which its version gate reads: docs/integrations/open-webui.md. - Not compatible: Haystack's Valkey document store, which needs valkey-search's reply formats (it fails on Redis 8 too): docs/integrations/haystack.md.
redis-pythroughout the end-to-end tests (tests/e2e/).
Builds and defaults
- The default port is 6380, not 6379.
- The default build has no Lua. The scripting commands return an error
there; use the
luaorfullbuild for job queues and anything else that runs scripts. - Scripts run on Lua 5.4, not Redis's Lua 5.1.
string.format('%d')and the other integer conversions take numbers with a fraction as 5.1 does, and numbers are passed to commands, returned, and encoded bycjsonandcmsgpackas Redis does. What stays 5.4:/gives a float that is written with.0(tostring(10 / 2)is"5.0", so keys built with..from a division differ; usemath.floororstring.format('%d')), integers are exact 64-bit numbers, and 5.4's syntax (//, bitwise operators,goto) andtable.unpackare there. The full list, with workarounds: SCRIPTS.md. save <points>has no effect: KiviDB doesn't snapshot on a schedule. Use the AOF orBGSAVE.appendfsync nois taken aseverysec;alwaysandeverysecdo what they do in Redis.- The config file is read strictly: an unknown directive stops the server.
- Without
--configfile, KiviDB still reads/etc/kividb/kividb.confif it exists, where Redis reads a config file only when one is named. Such a server logs a deprecation warning at startup and refusesCONFIG REWRITE; start it with--configfileto rewrite the file. A future minor release will read only a named config file.
Sets
- Small sets are kept as Redis keeps them, and
OBJECT ENCODINGsays so:intsetfor up toset-max-intset-entries(512) integers,listpackfor up toset-max-listpack-entries(128) members of up toset-max-listpack-value(64) bytes,hashtableotherwise. The twolistpacklimits go no higher than 128 and 64; a larger value is taken as those, andCONFIG GETsays so. Withset-max-intset-entriesset under 128, an intset that passes it becomes alistpackwhere Redis makes ahashtable; at the defaults the two agree. SSCANreturns anintsetor alistpackwhole, with cursor 0, as Redis does. Ahashtableis scanned a page at a time,COUNTbeing a hint as in Redis: a page can be shorter thanCOUNT, or empty, before the cursor comes back 0. Every member there for the whole scan is returned at least once, except in one case no ordinary data reaches: if a run of members that all hash alike makes the table rehash its members with a new seed while a scan is in progress, that scan may miss members (it still ends). A scan begun on 1.2.x or earlier and continued after an upgrade (or a cursor from another server) still ends without an error, but may miss or repeat members: begin it again.SMEMBERS,SSCAN,SINTER,SUNION,SDIFF,SPOPandSRANDMEMBERgive ahashtable's members in no particular order, as in Redis, and the order is not the one 1.2.x gave.
Hashes
- Small hashes are kept as Redis keeps them, and
OBJECT ENCODINGsays so:listpackfor up tohash-max-listpack-entries(512) fields with no field or value longer thanhash-max-listpack-value(64) bytes,listpackexfor such a hash once a field has a TTL,hashtableotherwise; a hash never goes back, andHSCANreturns alistpackwhole, with cursor 0. The two limits go no higher than 512 and 64 (the most one block holds); a larger value is taken as those, andCONFIG GETsays so (Redis keeps what it is given). Thehash-max-ziplist-*names set and report the same two settings. - A hash whose fields and values pass 65,535 bytes together is a
hashtableeven when it is within both limits (at most 511 fields of 64 bytes with 64-byte values fit one block); Redis's listpack holds more. - The 64-byte and 65,535-byte limits count a field's own bytes, as Redis's
do, whatever bytes it holds: a field that is not UTF-8 is as long as it
is, and
MEMORY USAGEcounts it so. - A lowered limit applies to a hash at its next write that sets a field
(
HSETand the like);HDELand field expiry never move a hash, as in Redis. HGETALL,HKEYS,HVALS,HSCANandHRANDFIELDgive the fields of alistpackor alistpackexin the order they were first set, field TTLs or not. Redis keeps alistpackexin the order of its deadlines, the fields with one first, soonest first; so once a field of a small hash has a TTL the two orders differ. They agree for alistpack.- A
hashtablegives its fields in no particular order, as in Redis, and the order is not the one 1.2.x gave (which kept the order fields were first set in, also for a hash that was ahashtableonly because of one long value). HSCANof ahashtablereads a page at a time,COUNTbeing a hint as in Redis: a page can be shorter thanCOUNT, or empty, before the cursor comes back 0. Every field there for the whole scan is returned at least once, except in one case no ordinary data reaches: if a run of fields that all hash alike makes the table rehash its fields with a new seed while a scan is in progress, that scan may miss fields (it still ends). A field whose TTL is due is left out of a page where readers do not see it. A scan begun on 1.2.x or earlier and continued after an upgrade (or a cursor from another server) still ends without an error, but may miss or repeat fields: begin it again.
Sorted sets
- Small sorted sets are kept as Redis keeps them, and
OBJECT ENCODINGsays so:listpackfor up tozset-max-listpack-entries(128) members of up tozset-max-listpack-value(64) bytes,skiplistotherwise (a table of members and an ordered index of them here). A set moves when a write adds a member past either limit, or when oneZADD(orGEOADD) gives more pairs than the entries limit, as in Redis; never back: a set taken back under the limit stays askiplist, as in Redis. A set made whole (a load,RESTORE,MIGRATE,ZRANGESTORE,ZUNIONSTOREand the other*STOREcommands) is alistpackif it fits, as Redis loads one. ZSCANreturns alistpackwhole, in order, with cursor 0, whateverCOUNTsays, as Redis does. Askiplistis scanned a page at a time, in no particular order,COUNTbeing a hint as in Redis: a page can be shorter thanCOUNT, or empty, before the cursor comes back 0. Every member there for the whole scan is returned at least once, except in one case no ordinary data reaches: if a run of members that all hash alike makes the table rehash its members with a new seed while a scan is in progress, that scan may miss members (it still ends). A scan begun on 1.2.x or earlier and continued after an upgrade (or a cursor from another server) still ends without an error, but may miss or repeat members: begin it again.- The two limits go no higher than 128 and 64 (the most one block holds);
a larger value is taken as those, and
CONFIG GETsays so (Redis keeps what it is given, and its listpack holds more). Thezset-max-ziplist-*names set and report the same two settings. A lowered limit applies to a set at its next new member; a changed score never moves a set, as in Redis. SORTof alistpacksorted set leaves it alistpack; Redis 8.10 turns the set it sorts into askiplist, soOBJECT ENCODINGdiffers after aSORT(the replies do not).
Lists
-
A list's elements are kept end to end in chunks of up to 64, as Redis keeps a quicklist of listpacks, but the size of a chunk is fixed: Redis closes a node at
list-max-listpack-size(8 kB by default), KiviDB at 64 elements. A list that has had an element longer than 1,024 bytes keeps every element in a block of its own from then on, as 1.2 kept every list. -
OBJECT ENCODINGsayslistpackwhile a list is one chunk andquicklistotherwise, so it differs from Redis in two ways:- Redis
listpack, KiviDBquicklist: lists of 65 to about 240 small elements (32 bytes each, say), and short lists that hold, or held, an element of 1,025 to 8,192 bytes. - Redis
quicklist, KiviDBlistpack: up to 64 elements of more than 8 kB in all, such as a few dozen elements of 1 kB.
Redis goes back to
listpackwhen a quicklist shrinks to one node of half the limit; KiviDB when it is down to one chunk, and never once its elements are kept apart. - Redis
-
list-max-listpack-size,list-max-ziplist-sizeandlist-compress-depthare accepted and reported, and change nothing: no chunk is compressed.
Durability
- With the AOF on, a write is acknowledged once its record is in the file,
as in Redis: a hard kill (
kill -9, the OOM killer) loses no acknowledged write while the disk keeps up, and a power failure up to a second, as with Redis'severysec. A reply waits at most 5 s for its record: a disk more than 5 s behind gets replies sent without their writes, counted inaof_acks_before_write(Redis waits for as long as the write takes). Before 1.2 a write was acknowledged once its record was queued, and a hard kill could lose the last few;aof-ack-after-write nostill does that, for more writes a second.
Data
- Keys, values, hash fields, set and sorted-set members, list elements,
stream consumer group and consumer names and vector-set element names are
any bytes, as in Redis. A hash keeps a field name as the bytes it was sent
as:
HSCAN MATCH,HRANDFIELD, field TTLs, keyspace notifications andSORT ... ->fieldsee those bytes. KDB snapshots,DUMPpayloads andDEBUG DIGEST-VALUEwrite a field name in the form 1.2 wrote it (a name that is UTF-8 is itself; any other is escaped as text), so files and payloads read the same on 1.2 and here, both ways. - ACL key and channel patterns (
~,%R~,%W~,&, and in selectors) are any bytes, and match a key's or channel's bytes exactly.ACL SETUSERrefuses white space and NUL in a pattern, as Redis does (and any Unicode white space, which the ACL file is split at).ACL LIST,ACL GETUSER,ACL LOGand the ACL file give a pattern's own bytes, as Redis writes them. In the ACL file a user name is read as written; a rule word that begins with a quote is read as Redis reads a quoted one ("~app:\xff*"); a line is split at white space, ASCII white space for a line that is not UTF-8; a pattern may hold a NUL. A user name in an ACL file must be UTF-8. What is still text: ACL user names and command rules, search index names, prefixes and field names, and time-series label names and values. - A HyperLogLog copied from Redis (
DUMP/RESTORE, an RDB, replication) loads and counts as it did on Redis. By default KiviDB writes new HyperLogLogs in its own format, which Redis refuses (INVALIDOBJ), andPFMERGEor a multi-keyPFCOUNTrefuses to combine the two formats. After moving from Redis, sethll-write-format redisso new and copied HyperLogLogs mix and can move back (PERSISTENCE.md). - Redis's RDB files, full syncs and
DUMPpayloads are read up to Redis 8.12's (RDB 17):RESTOREandMIGRATEfrom Redis 8.12 take what they take from Redis 8.10, in each encoding 8.12 writes (a large sorted set is abtreethere, and comes across as any sorted set). Two 8.12 types are refused, with an error naming them, and no key is made: a roaring bitmap (TYPEbitmap, made whilebitmap-default-roaringisyes), and a set whose members have their own TTLs (SPEXPIRE), as KiviDB keeps no TTLs for set members. Such a set keeps its encoding afterSPERSIST; copy it on Redis withSMEMBERSandSADDinto a new key to move it. A Count-min sketch made withCELL_SIZEis read when its counters are 4 bytes (the default), and refused with 1, 2 or 8: KiviDB's counters are 4 bytes. A file, full sync or payload from a newer Redis is refused, as Redis refuses one newer than its own. - Valkey 9.2's RDB format (version 81) isn't read yet: a file, full sync
or
DUMPpayload from it is refused. Valkey 9.0's and 9.1's (version 80, aVALKEY080header) is read, hash field TTLs included. - Redis and Valkey can't read KiviDB's
DUMPpayloads or replicate from KiviDB (#450), so moving data back off KiviDB means copying it key by key. Bloom and Cuckoo filters, Count-min sketches and Top-K sketches are the exception: their payloads are Redis's, and Redis restores them. DUMP/RESTOREandMIGRATEof time series and vector sets work between KiviDB nodes only: their payloads are KiviDB's own, and Redis's for these types (module values) aren't read either. A series' compaction rules and source are left out, as RedisTimeSeries leaves them out, so afterRESTORE,MIGRATEorMIGRATE-based resharding runTS.CREATERULEagain; an atomic slot migration (CLUSTER MIGRATION) recreates the rules itself. A vector set madeNOQUANTarrives as a set made without an option, so it then accepts aVADDwith any quantization option, the same as after a snapshot reload.- Vector sets: a set of 4,096 elements or more is searched in an HNSW graph,
as in Redis, and a smaller one is scanned (exact, and at that size no
slower). The graph is not saved in snapshots,
DUMPpayloads or full syncs, so files stay readable by 1.2: it is made again from the vectors after a load,RESTOREorCOPY, in the background, andVSIMscans the set until it is (COMMANDS.md). For the same reasonMand the buildEFgiven to theVADDthat made a set are not kept across a restart: the set has Redis's 16 and 200 again, and since it no longer knows theMit was made with, it takes aVADDwith anyM, where Redis refuses one other than the set's (asked M value mismatch; KiviDB refuses it too while the set'sMis known).CASis accepted and changes nothing. A filteredVSIMthat reaches itsFILTER-EFeffort scans the set and answers exactly, where Redis answers with what it found so far.VLINKSanswers one layer, the element's nearest2 * Melements, where there are no graph links to give: for a set under 4,096 elements (which has no graph), one whose graph is being made, and an element written and not linked yet.VINFO'sprojection-input-dimis always 0 (REDUCEis refused),hnsw-max-node-uidis the graph's node slots in use (slots of removed elements are used again), andvset-uidnumbers the sets a process has made, loaded, restored or copied: aCOPYhas a number of its own. A set that shrinks under 2,048 elements lets go of its graph. - Search:
SORTBYon aGEOfield is refused (Redis orders by the geohash).GEOSHAPEfields answer as in Redis 8.10 (POINTandPOLYGON,FLATandSPHERICAL, the four predicates from dialect 2 on); a SPHERICAL edge is a great-circle arc, where Redis measures it on the ellipsoid, a SPHERICAL polygon reaches at most 44.5 degrees from the middle of its points, a query has at most 16 shape clauses, andPOINT EMPTYis refused, and aFLATcoordinate must be 0 or between 1e-100 and 1e100 in magnitude, where Redis takes any finite one (see SEARCH.md).GEOfields,@field:[lon lat radius unit]andGEOFILTERanswer as in Redis 8.10, a document whoseGEOfield holds no point being left out of the index and counted inhash_indexing_failures; FT.INFO reports the failures underIndex Errors, not per field (field statistics). QueryTIMEOUT(orsearch-timeout) cuts a query short;ON_TIMEOUTorsearch-on-timeoutchooses a partial reply with a warning, or an error. With neither set a query has no time limit, where Redis's default is 500 ms, soFT.CONFIG GET TIMEOUTanswers0and Redis500.FT.CREATE … FILTER <expr>restricts an index to matching documents (using the same expression engine asFT.AGGREGATE).INT8andUINT8vectors aren't supported. Scores,NOFREQS,PHONETIC(dm:en,dm:fr,dm:pt,dm:es: the codes and the scores), the~and-of dialect 1 and the wayFT.AGGREGATEwrites numbers (12 significant digits) were compared with Redis 8.10.2 on the same data, and are its, but for these differences:- Scores: three of the compared queries differ from Redis's in the last
digit, all of three words (
apple cherry banana:SCORER BM25on two indexes, and the default scorer on one with field weights; the order Redis adds the terms in);TFIDF,TFIDF.DOCNORMandBM25of three or more words, one of which has a stem, can differ in the proximity factor; a fuzzy term scores one of the document's words it matches, which one can differ (seevector/score.rs). Documents with the same score come in the order they were written, as in Redis. - Limits of that order:
HEXPIREof an indexed field leaves the document where it is; with KNN andkbelow the number of vectors at the same distance, which of those are returned is not decided by the order they were written in; withaof-preamble no, the order after an AOF rewrite is that of the rewritten file;FT.HYBRIDdoes not use it; a replica fed from its master's stream can order level documents written at the same time from different connections otherwise than its master, so aLIMITpage that ends among them can differ; an index of vector fields only keeps the order of the keys; the documents written after anFT.CREATEwhile its first walk is still filling the index, saved in that window, load in the order of their keys. ARENAMEkeeps the document's place, as in Redis.FT.AGGREGATEgives groups in the order of their first documents written. - Dialect 1: a field modifier applies to the bare words that follow it
(
@title:a bis@title:(a b)) in Redis, to the first only here;=> {$weight: …}on a clause is accepted but does not weigh it (and is refused with a space after=>);$phonetic: falseon a group (@p:(a b)=>{…}) does not score as Redis does; the text of a syntax error and its offset differ. - After a document with a
PHONETICfield is changed or deleted, Redis keeps counting it in the frequency of the code term until its garbage collection has run, so scores differ until then; here the count is exact. FT.SEARCH RETURNshows a NUMERIC field as it was stored (Redis writes it as a double) and aKNNdistance as the shortest text of a 32-bit float (Redis, 12 significant digits);FT.AGGREGATEwith aGROUPBYand noLIMITreturns every group (Redis, 10); in the expressions ofAPPLYandFILTER,-x,a+bwith no space andround/poware accepted (Redis refuses them),^is not a power, a text that is not a number is 0 in arithmetic (Redis refuses it),SORTBYon a TEXT field of numbers sorts them as numbers (Redis, as text);COUNT_DISTINCTISHis exact andTOLISTlists in the order the values came, where Redis's order is its own;QUANTILEis exact (the value at rankceil(q * n)), which is what Redis gives for a small group, while for a group of thousands of values (4,000 were compared) Redis's answer is an estimate, close to it but not the same.FT.SPELLCHECKscores a suggestion by the documents that hold it over the documents in the index. Redis counts each time the term was indexed, so writing a document again raises the score: withsp:1holdinghelloandsp:2world,FT.SPELLCHECK sp heloscoreshello0.5, and afterHSET sp:1 t hellotwice more Redis scores it 1.5.- Without
RETURN,FT.SEARCHgives a hash's fields in the order of their names. Redis gives theSORTBYfield first, then the fields in the order they first appear across the page's documents, so the order of one document's fields depends on which documents share its page.
- Scores: three of the compared queries differ from Redis's in the last
digit, all of three words (
- A Redis RDB with search index definitions loads without them: run
FT.CREATEagain. Bloom filters load (RedisBloom 2.4 and later: Redis Stack 6.2 to 7.4, Redis 8), and so do Cuckoo filters, Count-min sketches and Top-K sketches. One with other module data (time series, vector sets, t-digests) is refused. - Bloom filters:
COPYcopies one, which Redis refuses. A filter made before RedisBloom 2.0 (32-bit hashes) is not loaded. A filter has size limits Redis does not have: a client's commands do not make or grow one pastbloom-max-filter-bytes(512 MiB unless raised) or 65,536 hashes in all its layers, and none of more than 2048 layers or 600,000 hashes is made, grown or loaded. Replication, the AOF and loads are held only to the last two, which no filter Redis grows reaches.BF.MADD,BF.INSERTandBF.MEXISTShave a per-command limit. What a header, a snapshot, an RDB file or aDUMPpayload says about a filter is checked before it is used: one Redis could not have made is refused. TheirDUMPpayloads carry RDB version 9, so every Redis since 6.0 canRESTOREthem. - Count-min sketches: counts are Redis's exactly (items are placed as
Redis places them).
COPYcopies one, which Redis refuses. A sketch has at most 134,217,728 counters and 65,536 rows, made or loaded;CMS.INCRBY,CMS.QUERYandCMS.MERGEhave per-command limits, checked before they start.CMS.MERGEnames its sources as keys (ACL patterns and cluster slots apply to them), and needs read permission on them and write permission on its destination (Redis checks only the destination, and takes read or write permission on it). See COMMANDS.md. - Top-K: with a decay of 1 every answer is Redis's; below 1, which bucket
decays is left to chance, drawn from a generator each sketch keeps (so
replicas and the AOF stay identical to the master), and answers are as
good as Redis's, not bit for bit the same.
DUMP(Redis's format) does not carry the generator: a copy made byRESTORE,MIGRATEor a slot's move starts it afresh, and from then on does not make the choices the original would have. Items are binary-safe (Redis cuts them at a zero byte in replies).COPYcopies one, which Redis refuses. Size limits (k 65,536, 67,108,864 buckets, 65,536 rows) and a per-command limit onTOPK.ADD,TOPK.INCRBY,TOPK.QUERYandTOPK.COUNT, checked before they start. See COMMANDS.md. - Cuckoo filters are Redis's byte for byte (replies,
CF.SCANDUMPchunks,DUMP).COPYcopies one, which Redis refuses. At most 1 GiB and 99 sub-filters, made, grown or loaded;CF.INSERT,CF.INSERTNXandCF.MEXISTShave a per-command limit, checked before they start, and a compaction stops at a limit of its own (a large filter compacts in part, where Redis's compaction goes on). A sub-filter over 16 MiB is dumped in pieces that follow on, which Redis does not do. See COMMANDS.md. - t-digests: answers are approximations within the same bounds as Redis's,
not bit for bit the same (where nothing is approximated, they are Redis's).
A query never changes a digest, so
TDIGEST.INFO's node counts can differ. TheirDUMPpayloads are KiviDB's own (Redis's are refused). A compression of at most 100,000; queries of many values and merges have a per-command limit.TDIGEST.MERGEneeds read permission on its sources and write permission on its destination (Redis takes read permission on the destination for write). See COMMANDS.md. - Set and sorted-set members can't have their own TTLs. A Dragonfly file
with a
SADDEXset, or a KeyDB file or stream withEXPIREMEMBERon a set or sorted-set member, is refused, naming the key. Hash field TTLs from either load. Dragonfly's Bloom, Cuckoo, count-min and top-k keys and its compressed snapshot blocks are refused (save with--compression_mode=0). - KiviDB can't be a replica of a KeyDB primary in active replication
(
active-replica yes): the link ends at its firstRREPLAY, saying so. Move that data by RDB file or withMIGRATE. JSON.NUMINCRBYandJSON.NUMMULTBYrefuse any integer result that does not fit ani64withERR numeric overflow, and change nothing. Redis returns that error too, with three exceptions KiviDB doesn't copy: it stores au64for some array elements (JSON.NUMINCRBY k $[0] 1on[9223372036854775807]succeeds), it gives a float for some integers abovei64::MAX, losing precision, and it can leave a multi-match path half done (#536).- A JSON array of 8 or more numbers, all integers that fit an
i64or all floats, is held packed, as Redis packs such arrays: 8 bytes an element, 4 for floats that are exactlyfloat32values (an embedding written as doubles). Replies are the same whichever way an array is held, andJSON.DEBUG MEMORYandMEMORY USAGEreport the bytes it takes held so. Redis also holds small integers in fewer bytes; KiviDB holds every integer of a packed array in 8 (#1001).
Server and introspection
timeoutcloses an idle client as Redis 8.10 does, and leaves the same clients alone: replicas and a replica's link to its master,MONITOR, clients blocked in a command, and subscribers. It is checked once a second for every client. A client in the middle of a long command is not idle; Redis, which runs one command at a time, does not look while one runs.tcp-keepalivesets the probe interval to a third of its value and three probes where the system lets them be set (Linux, macOS, FreeBSD; on Windows the interval only), as Redis does on Linux; aCONFIG SETapplies to connections accepted after it, as in Redis.- Where
timeoutdiffers from Redis 8.10: a client that ran a command for longer thantimeoutis given a fulltimeoutfrom the end of that command (Redis closes it right after its reply); a client that does not read its replies counts as busy, and is bounded byclient-output-buffer-limitrather than bytimeout; and a client that has sentREPLCONFis taken for a replica in its handshake and left alone. replica-serve-stale-data noanswers-MASTERDOWNas Redis 8.10 does, with the commands the Redis command table flagsstalestill answered. Differences: a script (EVAL,EVALSHA,FCALLand their_ROforms) is refused whatever its flags, where Redis runs one with#!lua flags=allow-stale(or a function registered withallow-stale); while a replica loads the dataset of a full sync it answers-LOADING, where Redis answers-MASTERDOWN; and insideEXECeach queued command is checked as it runs, so if the link goes down part way through, the later commands answer-MASTERDOWN(Redis runs the whole queue onceEXEChas started).HELLOandINFO'sredis_versionreport the Redis release KiviDB follows (server: redis,version: 8.10.0), as Dragonfly does, so that clients use what that release has: redis-py's and Jedis's client-side caches need Redis 7.4 or later. KiviDB's own release iskividb_version, inHELLOand inINFO.INFOalso hasvalkey_version:9.0.1, for clients that gate on the Valkey release (Open WebUI's Valkey vector store wants 9.0.1 or later);HELLOsaysredisonly.enable-debug-commandis Redis's,noby default from 1.3.0 (1.2.2 and earlier ignored it):DEBUGis refused with Redis's error unless the server started withyes, or withlocaland the client is on loopback (KiviDB has no Unix socket). InsideMULTIthe refusal discards the transaction, as in Redis.CONFIG SETrefuses it, whatever the value, as Redis does. One difference: a user whose ACL does not allowDEBUGgetsNOPERM(Redis checks the setting first).enable-protected-configsandenable-module-commandare accepted, in the config file and byCONFIG SET, and change nothing: KiviDB has no protected configs and no modules.MEMORY USAGEis an estimate;MEMORY MALLOC-STATSis a stub.keyspace_hitsandkeyspace_missesofINFO statscount a key a read command looks up as Redis does: a hit when the key is there (whatever its type, and whether or not the member, field or index asked for is in it), a miss when it is not; commands that write count neither, except for the keys they read first, as in Redis (BITOP's sources,PFMERGE's keys, the source ofGEOSEARCHSTORE,SORT ... STORE, the set and sorted-setSTOREforms).XREADandXREADGROUPcount each stream twice, as Redis does; the keysSORT'sBYandGETpatterns name count too. Known differences from Redis 8.12:TS.MGET,TS.MRANGEandTS.MREVRANGEcount nothing (Redis counts 2 hits for each series a filter matches);LINDEX l notanint, and aWEIGHTS,AGGREGATEorLIMITthat does not parse inZUNION,ZINTERorZINTERCARD, count nothing, where Redis counts the key it looked up before it refused the argument.OBJECT IDLETIMEis0unless amaxmemory-policythat uses it is set, orkey-access-tracking yesis (Redis always keeps it; the setting costs about 50 instructions a command, 1 to 1.5% of a pipelinedGETorSET).CLIENT NO-TOUCH: the client's reads leave a key's idle time and LFU count alone, andTOUCHstill touches, as in Redis. Its writes count as uses of their keys, and so do the keys a script declares when the client runs one that may write (EVAL,EVALSHA,FCALL); in Redis aNO-TOUCHclient's write to a key that is already there, or its script, leaves the key's use alone, and only a key it creates is marked used.client-output-buffer-limit's replica hard limit isrepl-replica-max-backlog-bytes(0: no limit, which liftsrepl-replica-sync-max-backlog-bytestoo); during a full sync a replica is held torepl-replica-sync-max-backlog-bytesinstead. A replica has no soft limit by default (slave 268435456 0 0; Redis: 64 MB for 60 seconds), on purpose: a burst a replica comes through should not become a full resync of a large dataset. One that is set holds only once the replica's queue has been under it after its full sync or partial resync. A redis.conf lineclient-output-buffer-limit replica 256mb 64mb 60turns it on, and overrides a raisedrepl-replica-max-backlog-bytesearlier in the file (the last line wins). The limits count the bytes waiting, not the allocator's rounding of them.MONITORshows every command once, as Redis does: nothing is dropped. A monitor that reads more slowly than commands run has what it has not read kept for it, held toclient-output-buffer-limit normal(the class Redis counts a monitor in; no limit by default, as in Redis); past that limit it is disconnected, withClient id=… closed: it is in MONITOR and … bytes behindin the log andclient_output_buffer_limit_disconnectionscounted; what it has not read shows in itsomeminCLIENT LIST. Every monitor sees the same order, a connection's commands always in the order it sent them, and time stamps in the order of the lines (they are read from the system clock, so they go back only when the clock is set back, as in Redis). A command is shown when it is called, before it runs; Redis shows it once it has run. So a script'sEVALis shown before the commands it calls (Redis: after them),SELECTis shown with the database it was called in (Redis: the one it selected), and two connections' commands on one key that arrive at nearly the same moment on two worker threads can have run in the other order than they are shown; Redis, with one thread, has no such moment.AUTHandHELLO … AUTHare not shown at all (Redis shows them with the password as(redacted)). Up to 1.2.2 a monitor that fell 4,096 lines behind lost lines without a word: with four connections sending at full speed, half or more of what they sent.- A replica doesn't enforce
maxmemoryon what its master sends. A replica of a KiviDB master older than 1.1.3 expires keys by its own clock (such a master sends noDELfor the keys it expires). A replica of a 1.2.0 master, and a 1.2.0 replica, expire hash fields by their own clock (1.2.0 sends noHDELfor the fields it expires, and a 1.2.0 replica does not wait for one).
Cluster
FT.SPELLCHECK,FT.PROFILEandFT.SYNDUMPanswer from the node they're sent to.FT.HYBRIDis refused in a cluster of more than one master ("FT.HYBRID is not supported across a cluster's masters yet"), where Redis answers it from every shard: one node's answer would be part of the cluster's. A cluster of one master answers it.- Without
tls-cluster, traffic between nodes is unencrypted, as in Redis. - KiviDB nodes cluster only with KiviDB nodes.
cluster-node-timeoutis read only at startup:CONFIG SETrefuses a new value, where Redis takes it at runtime. Set it in the config file or with--cluster-node-timeoutand restart the node. The announce settings (cluster-announce-ip,-port,-bus-port,-hostname,-client-port, and Valkey 8's-client-ipv4and-client-ipv6) andcluster-require-full-coveragecan be changed at runtime, as in Redis.cluster-announce-client-ipv4/-ipv6(Valkey 8): a client is told the address for the family of its own connection, as in Valkey; one that reaches a node listening on::over IPv4 (an IPv4-mapped address) counts as IPv4. They travel in a node's own heartbeats (the bus's flags string, not Valkey's ping extensions; never in gossip, as in Valkey), and are not saved innodes.conf: a restarted node tells clients a peer's own address until that peer's first heartbeat (about a second).- Keys a master holds of slots it does not serve (left, for example, on a
replica promoted after its master crashed right after handing slots over
in an atomic slot migration) are not deleted on their own. KiviDB logs a
warning, reports them in
INFO cluster(cluster_orphan_slots,cluster_orphan_keys) andCLUSTER ORPHANSLOTS, and deletes them when told withCLUSTER DROPORPHANS, which only runs on a master, for slots another master that is up owns, with no migration of them under way, and deletes only the keys that owner, asked directly, says it has. Both commands are KiviDB's own: Valkey'sCLUSTER FLUSHSLOTdeletes any slot's keys, the node's own included, and Redis'sSFLUSHonly those of slots the node owns. See COMMANDS.md. - A replica promoted after its master died part way through an atomic slot
import deletes what the import brought, as Redis 8 does, which tells its
replicas of the import in the stream (
CLUSTER SYNCSLOTS CONF ASM-TASK). Unlike Redis, which deletes every key of the import's slots the node does not own (and does so too when an import begins), KiviDB keeps the keys that were there before the import, and deletes only once the slot's owner, asked directly, says it owns the slot and is not moving it. The message (KIVIDB.IMPORTS) is KiviDB's own, sent only to replicas that ask for it withREPLCONF capa slot-imports, and is not part of the stream.
Performance
- Many clients writing to one key are slower while something follows the write stream (a replica, the replication backlog, a backup): about 210,000 writes a second against 1.1 million without, on 8 CPUs. Writes spread over many keys aren't affected.
COMMANDS.md lists the rest, down to single options. If something you rely on behaves differently from Redis and isn't listed here, please open an issue.