Commands

Note

DbSync implements the Redis Serialization Protocol (RESP2/RESP3). All commands listed here are wire-compatible with Redis clients.

Overview

DbSync supports a focused subset of the Redis command set, optimized for high-throughput key-value workloads. Commands are parsed using a zero-copy RESP parser for minimal overhead.

Implemented Commands currently available in the codebase.


Coming Soon Commands planned for future releases.


Implemented Commands

The following commands are currently implemented in DbSync's engine.

SETcommandrequired

Set a key to a string value with optional TTL.

SET key value [EX seconds] [PX milliseconds]
OptionDescription
EX secondsSet expiry in seconds
PX millisecondsSet expiry in milliseconds

Supports cross-core request hopping via the SPSC ITC bus when the key is owned by a different reactor.

Time complexity: O(1)

GETcommandrequired

Get the value of a key. Returns nil if the key does not exist.

GET key

If the key belongs to a remote shard, the request is transparently forwarded via the inter-thread communication bus.

Time complexity: O(1)

PINGcommandrequired

Test connectivity. Returns PONG.

PING
EXPIREcommandrequired

Set a timeout on a key (in seconds).

EXPIRE key seconds

Time complexity: O(1)

DELcommandrequired

Delete a key. Returns 1 if the key was deleted, 0 otherwise.

DEL key

Time complexity: O(1)

EXISTScommandrequired

Check if a key exists. Returns 1 if the key exists, 0 otherwise.

EXISTS key

Time complexity: O(1)

TTLcommandrequired

Get the time to live of a key in seconds. Returns -1 if no timeout is set, -2 if the key does not exist.

TTL key

Time complexity: O(1)

PTTLcommandrequired

Get the time to live of a key in milliseconds. Returns -1 if no timeout is set, -2 if the key does not exist.

PTTL key

Time complexity: O(1)

CONFIGcommand

Server configuration command. Used for client compatibility (e.g., CONFIG GET save).

CONFIG GET parameter
CONFIG SET parameter value

Pipelining

DbSync fully supports command pipelining. Clients can send multiple commands without waiting for individual responses, dramatically improving throughput.

# Example: pipeline 3 commands
(printf "SET key1 val1\r\nSET key2 val2\r\nGET key1\r\n"; sleep 1) | redis-cli --pipe
ModeThroughputLatency
No pipelining~120K ops/sec0.4ms
Pipeline depth 10~500K ops/sec0.8ms
Pipeline depth 100~900K ops/sec2.1ms
Tip

For maximum throughput, use a pipeline depth of 10–50. Beyond that, gains diminish while memory usage increases.


Coming Soon

The following commands are planned for upcoming releases:

CommandCategoryStatus
INCR / DECRString CommandsPlanned
INCRBY / DECRBYString CommandsPlanned
MGET / MSETMulti-key OperationsPlanned
PEXPIREKey ManagementPlanned
INFOServer CommandsPlanned
FLUSHDBServer CommandsPlanned
SHUTDOWNServer CommandsPlanned
Hash commands (HSET, HGET, HDEL)Data StructuresPlanned
List commands (LPUSH, RPUSH, LRANGE)Data StructuresPlanned
Set commands (SADD, SMEMBERS)Data StructuresPlanned
Sorted Sets (ZADD, ZRANGE)Data StructuresPlanned
Pub/Sub (SUBSCRIBE, PUBLISH)MessagingPlanned
Transactions (MULTI, EXEC)TransactionsPlanned
Note

Want to contribute? Check out the repository on GitHub and help implement new commands.