marekvs

Redis API reference

Implemented · some Planned

marekvs speaks RESP2 and RESP3. The tables below list the commands that are actually wired into the command dispatcher (crates/marekvs-engine/src/cmd/), so if a command is here, it runs. Commands that some tools assume exist but that marekvs does not implement are called out explicitly in Not implemented.

Note

Read guarantees are per connection: a connection sees its own writes and never reads backward in time. They are not cross-client — two clients on two nodes can briefly observe different values. See Consistency.

#Connection & server

CommandNotes
PING ECHOLiveness / echo.
HELLOProtocol handshake; selects RESP2/RESP3.
AUTHSingle-password auth when MAREKVS_REQUIREPASS is set.
QUIT RESETClose / reset the connection state.
SELECTAccepted (single logical keyspace).
CLIENT COMMAND CONFIG INFO DBSIZEIntrospection / runtime config.
FLUSHALL FLUSHDBClear data.
TIMEServer time.
REPLICAOF / SLAVEOFFollow a real Redis master (live migration).
SHUTDOWN DEBUGLifecycle / debug helpers.

A few settings are live-reconfigurable via CONFIG SET: requirepass, lua-time-limit, and loglevel.

#Generic / keyspace

CommandNotes
DEL UNLINK EXISTS TYPE TOUCHStandard key ops.
TTL PTTL EXPIRETIME PEXPIRETIMERead expiry.
EXPIRE PEXPIRE EXPIREAT PEXPIREAT PERSISTSet / clear expiry.
KEYS SCAN RANDOMKEYEnumerate keys.
RENAME RENAMENXRename keys.
EXPIREMEMBER EXPIREMEMBERAT PEXPIREMEMBERATKeyDB-style per-member TTL.
TTL key memberPer-member TTL read (KeyDB extension).

#Strings

CommandNotes
GET SET SETNX SETEX PSETEXGet / set with options.
GETSET GETDEL GETEXGet-and-mutate.
APPEND STRLEN SETRANGE GETRANGE / SUBSTRSubstring ops.
INCR DECR INCRBY DECRBY INCRBYFLOATCounters (see below).
MGET MSET MSETNXMulti-key get / set.
Done

INCR / DECR / INCRBY / DECRBY are backed by PN-counters: concurrent increments on different nodes are all preserved, never lost. An explicit SET resets the counter. See counters.

#Hashes

CommandNotes
HSET HMSET HSETNX HGET HMGET HGETALLField get / set.
HDEL HEXISTS HLEN HKEYS HVALS HSTRLENField inspection.
HINCRBY HINCRBYFLOATField arithmetic.
HRANDFIELD HSCANSample / iterate.

#Sets

CommandNotes
SADD SREM SCARD SISMEMBER SMISMEMBERMembership.
SMEMBERS SPOP SRANDMEMBER SSCANRead / sample / iterate.
SMOVEMove a member between sets.
SUNION SINTER SDIFF (+ STORE) SINTERCARDSet algebra.

Concurrent SADDs on different nodes both survive (ORSWOT merge).

#Sorted sets

CommandNotes
ZADD ZINCRBY ZREMAdd / mutate.
ZSCORE ZMSCORE ZCARD ZRANK ZREVRANK ZCOUNTInspect.
ZRANGE ZRANGEBYSCORE ZREVRANGE ZREVRANGEBYSCORERange queries.
ZPOPMIN ZPOPMAX ZREMRANGEBYSCORE ZSCANPop / trim / iterate.

#Lists

CommandNotes
LPUSH RPUSH LPUSHX RPUSHXPush.
LPOP RPOP LLEN LRANGE LINDEXPop / read.
LSET LREM LTRIM LINSERT LPOSMutate / search.
LMOVE RPOPLPUSHMove between lists.
BLPOP BRPOP BLMOVE BRPOPLPUSHBlocking variants.
Note

Lists are per-element position-keyed LWW registers. Blocking commands poll at ~50 ms and also wake on a replicated push. Concurrent cross-node pushes can collide on a position — see the list caveat.

#Streams

CommandNotes
XADD XLEN XDEL XTRIMAppend / size / trim.
XRANGE XREVRANGE XREADRead entries.
Warning

Consumer groups are not implementedXGROUP, XREADGROUP, XACK, XCLAIM, XAUTOCLAIM, XPENDING, XSETID, and XINFO are absent. Streams provide raw, at-least-once entry operations only.

#HyperLogLog

CommandNotes
PFADD PFCOUNT PFMERGEConvergent (per-register max) cardinality.

#Pub/Sub

CommandNotes
SUBSCRIBE UNSUBSCRIBE PSUBSCRIBE PUNSUBSCRIBEChannel / pattern.
PUBLISH PUBSUBPublish / introspect.

#Scripting

CommandNotes
EVAL EVALSHA SCRIPTLua 5.4; keys must co-locate. See Lua scripting.

#Transactions

CommandNotes
MULTI EXEC DISCARDQueue and run sequentially.
Warning

Transactions are a convenience batch, not ACID: queued commands run sequentially with no atomicity beyond per-key shard serialization. WATCH / UNWATCH are rejected with an error — marekvs is AP and has no transactional compare-and-swap.

#Not implemented

These are not in the dispatch table, even though some clients or older design notes assume them. Calling one returns an error:

  • Keyspace: COPY, OBJECT, SORT, DUMP, RESTORE, MOVE
  • Sorted set: ZMPOP, ZRANDMEMBER, ZRANGESTORE, ZREMRANGEBYRANK, ZREMRANGEBYLEX, ZLEXCOUNT
  • List: LMPOP
  • Stream: XSETID, XINFO, consumer-group commands
  • Cluster / HA: WAIT, FAILOVER, CLUSTER, FUNCTION (no Redis Cluster protocol, no MOVED/ASK)
  • Modules / extras: GEO*, JSON*, bitfield/bit ops, CLIENT TRACKING (client-side caching)
  • Transport: no TLS.

#Cross-cutting semantics

  • Protocols: RESP2 and RESP3, negotiated with HELLO; inline commands are supported.
  • Atomicity: per-key only. A key's operations are serialized on one shard thread; there is no multi-key or cross-node atomicity.
  • Type errors: operating on the wrong structure returns WRONGTYPE.
  • Expiry: absolute deadlines decided at the origin, converging cluster-wide.
  • Counters: exact under concurrency (PN-counters).
  • Blocking commands: implemented via ~50 ms polling that also wakes on a replicated push.

#Where to go next