Redisun 1.0.0 Released: A Lightweight Java Redis Client for the Domestic Open‑Source Ecosystem

Redisun 1.0.0, a 33 KB Java Redis client built on the smart‑socket framework, offers lightweight packaging, high‑performance AIO communication, connection reuse, and full RESP support; the article details its architecture, core components, supported commands, Maven installation, quick‑start code, advanced SET usage, and future roadmap.

Three Knives
Three Knives
Three Knives
Redisun 1.0.0 Released: A Lightweight Java Redis Client for the Domestic Open‑Source Ecosystem

Release Announcement

We are excited to announce Redisun 1.0.0, a lightweight Redis client for the Java platform built on the smart‑socket network framework and released under the Apache License 2.0.

Background

Most Java Redis clients depend on heavyweight frameworks such as Netty, resulting in large JAR sizes and high resource consumption. To meet the demand for a lightweight, high‑performance client, we developed Redisun on the self‑developed smart‑socket framework.

Core Architecture

Redisun consists of five core classes that implement the Redis protocol specification, enabling easy extension of additional commands.

Key Advantages

Extreme lightweight : the JAR is only 33 KB.

High‑performance communication : built on smart‑socket Java AIO, offering stronger single‑threaded processing and lower resource usage.

Connection reuse : a single connection can handle multiple concurrent requests, greatly increasing throughput.

Full RESP support : compatible with Redis servers.

Core Components

Redisun : main client class providing connection management and command execution.

Command : abstract base for Redis commands, supporting custom extensions.

RESP : parser for the Redis serialization protocol.

RedisMessageProcessor : processes server responses.

RedisSession : maintains session state.

Supported Commands (v1.0.0)

HELLO

– handshake and authentication SET – set key with options (NX, XX, EX, PX, EXAT, PXAT, KEEPTTL) GET – retrieve key value DEL – delete one or more keys ZADD – add member to sorted set

Additional commands will be added in future releases.

Installation (Maven)

<dependency>
    <groupId>tech.smartboot</groupId>
    <artifactId>redisun</artifactId>
    <version>1.0.0</version>
</dependency>

Quick Start

import tech.smartboot.redisun.Redisun;

Redisun redisun = Redisun.create(options -> {
    options.setAddress("redis://127.0.0.1:6379");
});

// SET command
boolean setResult = redisun.set("mykey", "myvalue");
System.out.println("SET command result: " + setResult);

// GET command
String getResult = redisun.get("mykey");
System.out.println("GET command result: " + getResult);

// ZADD command
int zaddResult = redisun.zadd("myzset", 1.0, "member1");
System.out.println("ZADD command result: " + zaddResult);

// DEL command
int delResult = redisun.del("mykey");
System.out.println("DEL command result: " + delResult);

redisun.close();

Advanced SET Usage

Redisun redisun = Redisun.create(options -> {
    options.setAddress("redis://127.0.0.1:6379");
});

// NX option (set if not exists)
boolean nxResult = redisun.set("key2", "value2", cmd -> cmd.setIfNotExists());

// XX option (set if exists)
boolean xxResult = redisun.set("key1", "newvalue", cmd -> cmd.setIfExists());

// Expire in seconds
redisun.set("key3", "value3", cmd -> cmd.expire(60));

// Expire in milliseconds
redisun.set("key4", "value4", cmd -> cmd.expireMs(30000));

// Expire at specific time
redisun.set("key5", "value5", cmd -> cmd.expireAt(new Date(System.currentTimeMillis() + 60000)));

// Keep existing TTL
redisun.set("key1", "anotherValue", cmd -> cmd.keepTTL());

redisun.close();

Future Roadmap

Command expansion : gradually implement more Redis commands.

Performance optimization : continue improving connection management and data transfer speed.

Feature enhancement : add support for Redis Cluster, Sentinel, and other enterprise‑level features.

Ecosystem enrichment : provide more examples, documentation, and community support.

The project welcomes contributions to the open‑source community.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

JavaRedisOpen Sourcelightweightsmart-socketRedis client
Three Knives
Written by

Three Knives

Every line of code you contribute to open source could help make the future better.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.