Skip to content

Command Comparison Chart

Below is a comprehensive chart comparing common Redis commands between Lettuce and Valkey GLIDE:

CommandLettuceValkey GLIDE
ConnectRedisClient.create("redis://host:port")GlideClient.createClient(config)
ClusterRedisClusterClient.create(redisUri)GlideClusterClient.createClient(config)
AuthsyncCommands.auth("pass")client.updateConnectionPassword("pass", true)
Select DBsyncCommands.select(1)client.select(1)
CommandLettuceValkey GLIDE
SETsyncCommands.set("key", "val")client.set("key", "val")
GETsyncCommands.get("key")client.get("key").get()
SETEXsyncCommands.setex("key", 5, "val")client.set("key", "value", SetOptions.builder().expiry(Seconds(5L)).build()).get()
SETNXsyncCommands.setnx("key", "val")client.set("key", "val", SetOptions.builder().conditionalSet(ConditionalChange.ONLY_IF_DOES_NOT_EXIST).build()).get()
MSETsyncCommands.mset(map)client.mset(map)
MGETsyncCommands.mget("key1", "key2")client.mget(new String[]{"key1", "key2"})
INCRsyncCommands.incr("counter")client.incr("counter")
DECRsyncCommands.decr("counter")client.decr("counter")
INCRBYsyncCommands.incrby("counter", 5)client.incrBy("counter", 5)
DECRBYsyncCommands.decrby("counter", 5)client.decrBy("counter", 5)
APPENDsyncCommands.append("key", "val")client.append("key", "val")
GETRANGEsyncCommands.getrange("key", 0, 3)client.getRange("key", 0, 3)
SETRANGEsyncCommands.setrange("key", 0, "val")client.setRange("key", 0, "val")
CommandLettuceValkey GLIDE
DELsyncCommands.del("key1", "key2")client.del(new String[]{"key1", "key2"})
EXISTSsyncCommands.exists("key1", "key2")client.exists(new String[]{"key1", "key2"})
EXPIREsyncCommands.expire("key", 10)client.expire("key", 10)
TTLsyncCommands.ttl("key")client.ttl("key")
KEYSsyncCommands.keys("pattern")client.keys("pattern")
SCANScanIterator.scan(syncCommands, cursor)client.scan("0")
RENAMEsyncCommands.rename("old", "new")client.rename("old", "new")
RENAMENXsyncCommands.renamenx("old", "new")client.renameNx("old", "new")
CommandLettuceValkey GLIDE
HSETsyncCommands.hset("hash", map)client.hset("hash", map)
HGETsyncCommands.hget("hash", "field")client.hget("hash", "field")
HMSETsyncCommands.hmset("hash", map)client.hset("hash", map)
HMGETsyncCommands.hmget("hash", "f1", "f2")client.hmget("hash", new String[]{"f1", "f2"})
HGETALLsyncCommands.hgetall("hash")client.hgetall("hash")
HDELsyncCommands.hdel("hash", "f1", "f2")client.hdel("hash", new String[]{"f1", "f2"})
HEXISTSsyncCommands.hexists("hash", "field")client.hexists("hash", "field")
CommandLettuceValkey GLIDE
LPUSHsyncCommands.lpush("list", "a", "b")client.lpush("list", new String[]{"a", "b"})
RPUSHsyncCommands.rpush("list", "a", "b")client.rpush("list", new String[]{"a", "b"})
LPOPsyncCommands.lpop("list")client.lpop("list")
RPOPsyncCommands.rpop("list")client.rpop("list")
LRANGEsyncCommands.lrange("list", 0, -1)client.lrange("list", 0, -1)
CommandLettuceValkey GLIDE
SADDsyncCommands.sadd("set", "a", "b")client.sadd("set", new String[]{"a", "b"})
SMEMBERSsyncCommands.smembers("set")client.smembers("set")
SREMsyncCommands.srem("set", "a", "b")client.srem("set", new String[]{"a", "b"})
SISMEMBERsyncCommands.sismember("set", "a")client.sismember("set", "a")
CommandLettuceValkey GLIDE
ZADDsyncCommands.zadd("zset", scoreMembers)client.zadd("zset", scoreMembers)
ZRANGEsyncCommands.zrange("zset", 0, -1)client.zrange("zset", 0, -1)
ZRANGE with scoressyncCommands.zrangeWithScores("zset", 0, -1)client.zrange("zset", 0, -1, "WITHSCORES")
ZREMsyncCommands.zrem("zset", "a", "b")client.zrem("zset", new String[]{"a", "b"})
ZSCOREsyncCommands.zscore("zset", "a")client.zscore("zset", "a")
ZRANKsyncCommands.zrank("zset", "a")client.zrank("zset", "a")
ZREVRANKsyncCommands.zrevrank("zset", "a")client.zrevrank("zset", "a")
CommandLettuceValkey GLIDE
MULTI/EXECsyncCommands.multi(); syncCommands.set("k", "v"); syncCommands.exec();client.exec(new Transaction().set("k", "v"))
CommandLettuceValkey GLIDE
EVALsyncCommands.eval(script, outputType, keys, args)client.invokeScript(new Script(script), options)
EVALSHAsyncCommands.evalsha(sha, outputType, keys, args)client.invokeScript(new Script(script), options)
CommandLettuceValkey GLIDE
Raw CommandsyncCommands.dispatch(commandType, output, args)client.customCommand(new String[]{"CMD", "arg1", "arg2"})
CommandLettuceValkey GLIDE
Closeconnection.close(); client.shutdown();client.close()