Redisun 1.1.0: A Lightweight High‑Performance Java Redis Client and the Code‑World Feedback Loop
Redisun 1.1.0, a Java‑based lightweight high‑performance Redis client built on smart‑socket, introduces major upgrades in performance, command coverage, code quality and documentation, provides Maven integration and code examples, and demonstrates superior async and sync throughput compared with Redisson, Jedis and Lettuce in high‑concurrency benchmarks.
Redisun 1.1.0 Overview
Redisun 1.1.0 is a lightweight high‑performance Redis client for the Java platform, built on the smart‑socket network framework and using an asynchronous non‑blocking I/O model.
Performance Optimisation and Stability
Connection reuse optimisation reduces resource consumption.
Asynchronous operation flow refactor improves response speed.
Improved behaviour under high‑concurrency scenarios.
Command Support – 30 Core Commands
HELLO– server handshake and authentication SET – set key‑value with full options (NX, XX, EX, PX, PXAT, KEEPTTL) GET – retrieve a key’s value DEL – delete one or more keys EXISTS – check key existence EXPIRE – set key expiration with options (NX, XX, GT, LT) TTL – get remaining time‑to‑live TYPE – get key type FLUSHALL – clear all databases FLUSHDB – clear current database DBSIZE – return number of keys in current database SELECT – switch database (initial connection only) MSET – set multiple key‑value pairs MGET – get values of multiple keys STRLEN – get length of a string value APPEND – append to a string INCR – increment integer value DECR – decrement integer value INCRBY – increment by a given amount DECRBY – decrement by a given amount HSET – set hash field HGET – get hash field LPUSH – push element to list head RPUSH – push element to list tail LPOP – pop element from list head RPOP – pop element from list tail SADD – add member(s) to set ZADD – add member to sorted set ZREM – remove member from sorted set ZRANGE – get range of sorted‑set members ZSCORE – get score of a sorted‑set member
Code Quality and Documentation
Version 1.1.0 adds richer code comments, expands test coverage, and improves overall stability and maintainability.
Quick Start – Maven Dependency
<dependency>
<groupId>tech.smartboot</groupId>
<artifactId>redisun</artifactId>
<version>1.1.0</version>
</dependency>Basic Usage Example
import tech.smartboot.redisun.Redisun;
public class BasicExample {
public static void main(String[] args) {
Redisun redisun = Redisun.create(options ->
options.setAddress("127.0.0.1:6379")
.debug(true));
boolean setResult = redisun.set("hello", "world");
System.out.println("SET result: " + setResult);
String getResult = redisun.get("hello");
System.out.println("GET result: " + getResult);
int delResult = redisun.del("hello");
System.out.println("DEL result: " + delResult);
redisun.close();
}
}Advanced Feature Example
// Sorted‑set operation
int zaddResult = redisun.zadd("myzset", 1.0, "member1");
System.out.println("ZADD result: " + zaddResult);
// SET with options
boolean setOpt = redisun.set("key", "value", cmd ->
cmd.expire(60) // 60‑second TTL
.setIfNotExists()); // only if key does not exist
System.out.println("SET with options result: " + setOpt);Performance Benchmark
Tested against Redisson, Jedis, and Lettuce under the following environment:
OS: Ubuntu 20.04
JDK: 8
Redis server: latest
Test keys: 50,000
Key metrics (operations per second, OPS):
Asynchronous SET: 485,000+ OPS ( >8× Lettuce )
Asynchronous GET: 180,000+ OPS ( >20× Lettuce )
Synchronous SET: 76,000+ OPS (2–3× other clients)
Synchronous GET: 57,000+ OPS (≈2× other clients)
Stable performance at 2,048 concurrent connections with lower resource consumption and faster response.
Conclusion
Redisun demonstrates clear advantages in high‑concurrency and asynchronous scenarios, delivering significantly higher throughput and lower latency than comparable Java Redis clients, making it well‑suited for applications that must handle massive concurrent requests.
References
[1]smart‑socket: https://gitee.com/smartboot/smart-socket [2] Official site: https://smartboot.tech/redisun
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Three Knives
Every line of code you contribute to open source could help make the future better.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
