Command Comparison Chart
Below is a comprehensive chart comparing common Redis commands between Redisson and Valkey GLIDE:
Connection
Section titled “Connection”| Command | Redisson | Valkey GLIDE |
|---|---|---|
| Connect | Redisson.create(config) | GlideClient.createClient(config).get() |
| Cluster | config.useClusterServers() | GlideClusterClient.createClient(config).get() |
| Auth | config.setPassword("pass") | client.updateConnectionPassword("pass", true).get() |
| Select DB | config.setDatabase(1) | client.select(1).get() |
Strings
Section titled “Strings”| Command | Redisson | Valkey GLIDE |
|---|---|---|
| SET | redisson.getBucket("key").set("val") | client.set("key", "val") |
| GET | redisson.getBucket("key").get() | client.get("key").get() |
| SETEX | bucket.set("val", Duration.ofSeconds(5)) | client.set("key", "value", SetOptions.builder().expiry(Seconds(5L)).build()).get() |
| SETNX | bucket.trySet("val") | client.set("key", "val", SetOptions.builder().conditionalSet(ConditionalChange.ONLY_IF_DOES_NOT_EXIST).build()).get() |
| MSET | redisson.getBuckets().set(map) | client.mset(map) |
| MGET | redisson.getBuckets().get("k1", "k2") | client.mget(new String[]{"k1", "k2"}).get() |
| INCR | redisson.getAtomicLong("key").incrementAndGet() | client.incr("counter").get() |
| DECR | redisson.getAtomicLong("key").decrementAndGet() | client.decr("counter").get() |
| INCRBY | redisson.getAtomicLong("key").addAndGet(5) | client.incrBy("counter", 5).get() |
| DECRBY | redisson.getAtomicLong("key").addAndGet(-5) | client.decrBy("counter", 5).get() |
| APPEND | Manual get/concatenate/set | client.append("key", "val").get() |
| GETRANGE | Manual substring operation | client.getRange("key", 0, 3).get() |
| SETRANGE | Manual string manipulation | client.setRange("key", 0, "val").get() |
| Command | Redisson | Valkey GLIDE |
|---|---|---|
| DEL | redisson.getKeys().delete("k1", "k2") | client.del(new String[]{"k1", "k2"}).get() |
| EXISTS | redisson.getKeys().countExists("k1", "k2") | client.exists(new String[]{"k1", "k2"}).get() |
| EXPIRE | bucket.expire(Duration.ofSeconds(10)) | client.expire("key", 10).get() |
| TTL | bucket.remainTimeToLive() | client.ttl("key").get() |
| KEYS | redisson.getKeys().getKeysByPattern("*") | client.keys("pattern").get() |
| SCAN | redisson.getKeys().getKeysStream() | client.scan(cursor).get() |
| RENAME | bucket.rename("newkey") | client.rename("old", "new").get() |
| RENAMENX | bucket.renamenx("newkey") | client.renameNx("old", "new").get() |
Hashes
Section titled “Hashes”| Command | Redisson | Valkey GLIDE |
|---|---|---|
| HSET | redisson.getMap("hash").putAll(map) | client.hset("hash", map).get() |
| HGET | redisson.getMap("hash").get("field") | client.hget("hash", "field").get() |
| HMSET | redisson.getMap("hash").putAll(map) | client.hset("hash", map).get() |
| HMGET | redisson.getMap("hash").getAll(fields) | client.hmget("hash", new String[]{"f1", "f2"}).get() |
| HGETALL | redisson.getMap("hash").readAllMap() | client.hgetall("hash").get() |
| HDEL | redisson.getMap("hash").remove("field") | client.hdel("hash", new String[]{"f1", "f2"}).get() |
| HEXISTS | redisson.getMap("hash").containsKey("field") | client.hexists("hash", "field").get() |
| Command | Redisson | Valkey GLIDE |
|---|---|---|
| LPUSH | redisson.getList("list").addFirst("val") | client.lpush("list", new String[]{"a", "b"}).get() |
| RPUSH | redisson.getList("list").add("val") | client.rpush("list", new String[]{"a", "b"}).get() |
| LPOP | redisson.getList("list").removeFirst() | client.lpop("list").get() |
| RPOP | redisson.getList("list").removeLast() | client.rpop("list").get() |
| LRANGE | redisson.getList("list").range(0, -1) | client.lrange("list", 0, -1).get() |
| Command | Redisson | Valkey GLIDE |
|---|---|---|
| SADD | redisson.getSet("set").add("val") | client.sadd("set", new String[]{"a", "b"}).get() |
| SMEMBERS | redisson.getSet("set").readAll() | client.smembers("set").get() |
| SREM | redisson.getSet("set").remove("val") | client.srem("set", new String[]{"a", "b"}).get() |
| SISMEMBER | redisson.getSet("set").contains("val") | client.sismember("set", "a").get() |
Sorted Sets
Section titled “Sorted Sets”| Command | Redisson | Valkey GLIDE |
|---|---|---|
| ZADD | redisson.getScoredSortedSet("zset").add(1.0, "a") | client.zadd("zset", scoreMembers).get() |
| ZRANGE | redisson.getScoredSortedSet("zset").valueRange(0, -1) | client.zrange("zset", 0, -1).get() |
| ZRANGE with scores | redisson.getScoredSortedSet("zset").entryRange(0, -1) | client.zrange("zset", 0, -1, "WITHSCORES").get() |
| ZREM | redisson.getScoredSortedSet("zset").remove("a") | client.zrem("zset", new String[]{"a", "b"}).get() |
| ZSCORE | redisson.getScoredSortedSet("zset").getScore("a") | client.zscore("zset", "a").get() |
| ZRANK | redisson.getScoredSortedSet("zset").rank("a") | client.zrank("zset", "a").get() |
| ZREVRANK | redisson.getScoredSortedSet("zset").revRank("a") | client.zrevrank("zset", "a").get() |
Transactions
Section titled “Transactions”| Command | Redisson | Valkey GLIDE |
|---|---|---|
| MULTI/EXEC | redisson.createBatch().execute() | client.exec(new Transaction().set("k", "v")).get() |
Lua Scripts
Section titled “Lua Scripts”| Command | Redisson | Valkey GLIDE |
|---|---|---|
| EVAL | redisson.getScript().eval(script, keys, args) | client.invokeScript(new Script(script), options).get() |
| EVALSHA | redisson.getScript().evalSha(sha, keys, args) | client.invokeScript(new Script(script), options).get() |
Custom Commands
Section titled “Custom Commands”| Command | Redisson | Valkey GLIDE |
|---|---|---|
| Raw Command | Not directly supported | client.customCommand(new String[]{"SET", "key", "value"}).get() |
Connection Management
Section titled “Connection Management”| Command | Redisson | Valkey GLIDE |
|---|---|---|
| Close | redisson.shutdown(); | client.close() |