Command Comparison Chart
Below is a comprehensive chart comparing common Redis commands between Jedis and Valkey GLIDE:
Connection
Section titled “Connection”| Command | Jedis | Valkey GLIDE |
|---|---|---|
| Connect | new Jedis("host", port) | GlideClient.createClient(config).get() |
| Cluster | new JedisCluster(jedisClusterNodes) | GlideClusterClient.createClient(config).get() |
| Auth | jedis.auth("pass") | client.updateConnectionPassword("pass", true).get() |
| Select DB | jedis.select(1) | client.select(1).get() |
Strings
Section titled “Strings”| Command | Jedis | Valkey GLIDE |
|---|---|---|
| SET | jedis.set("key", "val") | client.set("key", "val") |
| GET | jedis.get("key") | client.get("key").get() |
| SETEX | jedis.setex("key", 10, "val") | client.set("key", "value", SetOptions.builder().expiry(Seconds(5L)).build()).get() |
| SETNX | jedis.setnx("key", "val") | client.set("key", "val", SetOptions.builder().conditionalSet(ConditionalChange.ONLY_IF_DOES_NOT_EXIST).build()).get() |
| MSET | jedis.mset(map) | client.mset(map) |
| MGET | jedis.mget("key1", "key2") | client.mget(new String[]{"key1", "key2"}).get() |
| INCR | jedis.incr("counter") | client.incr("counter").get() |
| DECR | jedis.decr("counter") | client.decr("counter").get() |
| INCRBY | jedis.incrBy("counter", 5) | client.incrBy("counter", 5).get() |
| DECRBY | jedis.decrBy("counter", 5) | client.decrBy("counter", 5).get() |
| APPEND | jedis.append("key", "val") | client.append("key", "val").get() |
| GETRANGE | jedis.getrange("key", 0, 3) | client.getRange("key", 0, 3).get() |
| SETRANGE | jedis.setrange("key", 0, "val") | client.setRange("key", 0, "val").get() |
| Command | Jedis | Valkey GLIDE |
|---|---|---|
| DEL | jedis.del("key1", "key2") | client.del(new String[]{"key1", "key2"}).get() |
| EXISTS | jedis.exists("key1", "key2") | client.exists(new String[]{"key1", "key2"}).get() |
| EXPIRE | jedis.expire("key", 10) | client.expire("key", 10).get() |
| TTL | jedis.ttl("key") | client.ttl("key").get() |
| KEYS | jedis.keys("pattern") | client.keys("pattern").get() |
| SCAN | jedis.scan(cursor) | client.scan(cursor).get() |
| RENAME | jedis.rename("old", "new") | client.rename("old", "new").get() |
| RENAMENX | jedis.renamenx("old", "new") | client.renameNx("old", "new").get() |
Hashes
Section titled “Hashes”| Command | Jedis | Valkey GLIDE |
|---|---|---|
| HSET | jedis.hset("hash", map) | client.hset("hash", map).get() |
| HGET | jedis.hget("hash", "field") | client.hget("hash", "field").get() |
| HMSET | jedis.hmset("hash", map) | client.hset("hash", map).get() |
| HMGET | jedis.hmget("hash", "f1", "f2") | client.hmget("hash", new String[]{"f1", "f2"}).get() |
| HGETALL | jedis.hgetAll("hash") | client.hgetall("hash").get() |
| HDEL | jedis.hdel("hash", "f1", "f2") | client.hdel("hash", new String[]{"f1", "f2"}).get() |
| HEXISTS | jedis.hexists("hash", "field") | client.hexists("hash", "field").get() |
| Command | Jedis | Valkey GLIDE |
|---|---|---|
| LPUSH | jedis.lpush("list", "a", "b") | client.lpush("list", new String[]{"a", "b"}).get() |
| RPUSH | jedis.rpush("list", "a", "b") | client.rpush("list", new String[]{"a", "b"}).get() |
| LPOP | jedis.lpop("list") | client.lpop("list").get() |
| RPOP | jedis.rpop("list") | client.rpop("list").get() |
| LRANGE | jedis.lrange("list", 0, -1) | client.lrange("list", 0, -1).get() |
| Command | Jedis | Valkey GLIDE |
|---|---|---|
| SADD | jedis.sadd("set", "a", "b") | client.sadd("set", new String[]{"a", "b"}).get() |
| SMEMBERS | jedis.smembers("set") | client.smembers("set").get() |
| SREM | jedis.srem("set", "a", "b") | client.srem("set", new String[]{"a", "b"}).get() |
| SISMEMBER | jedis.sismember("set", "a") | client.sismember("set", "a").get() |
Sorted Sets
Section titled “Sorted Sets”| Command | Jedis | Valkey GLIDE |
|---|---|---|
| ZADD | jedis.zadd("zset", 1, "a", 2, "b") | client.zadd("zset", scoreMembers).get() |
| ZRANGE | jedis.zrange("zset", 0, -1) | client.zrange("zset", 0, -1).get() |
| ZRANGE with scores | jedis.zrangeWithScores("zset", 0, -1) | client.zrange("zset", 0, -1, "WITHSCORES").get() |
| ZREM | jedis.zrem("zset", "a", "b") | client.zrem("zset", new String[]{"a", "b"}).get() |
| ZSCORE | jedis.zscore("zset", "a") | client.zscore("zset", "a").get() |
| ZRANK | jedis.zrank("zset", "a") | client.zrank("zset", "a").get() |
| ZREVRANK | jedis.zrevrank("zset", "a") | client.zrevrank("zset", "a").get() |
Transactions
Section titled “Transactions”| Command | Jedis | Valkey GLIDE |
|---|---|---|
| MULTI/EXEC | jedis.multi().set("k", "v").exec() | client.exec(new Transaction().set("k", "v")).get() |
Lua Scripts
Section titled “Lua Scripts”| Command | Jedis | Valkey GLIDE |
|---|---|---|
| EVAL | jedis.eval(script, numKeys, keys, args) | client.invokeScript(new Script(script), options).get() |
| EVALSHA | jedis.evalsha(sha, numKeys, keys, args) | client.invokeScript(new Script(script), options).get() |
Custom Commands
Section titled “Custom Commands”| Command | Jedis | Valkey GLIDE |
|---|---|---|
| Raw Command | jedis.sendCommand(Command.SET, "key", "value") | client.customCommand(new String[]{"SET", "key", "value"}).get() |
Connection Management
Section titled “Connection Management”| Command | Jedis | Valkey GLIDE |
|---|---|---|
| Close | jedis.close(); cluster.close(); | client.close() |