Rād «ᚱ» is a small, zero-dependency Redis client for Clojure (JDK 21+).
Caution
Rad is alpha-quality software. While the API proper (the rad.api
namespace) is unlikely to change, the logging implementation (rad.log
) very well might.
user=> (require '[rad.api :as rad])
nil
;; Connect to default Redis host ("localhost") and port (6379).
user=> (def redis (rad/client :decode rad/bytes->str))
#'user/redis
;; Send a command pipeline.
user=> @(redis [:ECHO "Hello"] [:ECHO "world!"])
["Hello", "world!"]
;; Close the connection.
user=> (redis)
nil
- No runtime dependencies
- Minimal API
- RESP3 support
- Pipelining support
- Supports every version of Redis that supports RESP3
- One connection per client (including pub/sub)
- Automatically reconnects when disconnected
- Reasonable sequential throughput, pretty good concurrent throughput over a single connection
See documentation and API documentation.
If you want to know how Rad works, see also the architecture documentation.
See examples
.
- Connection pooling
- RESP3-only
- No automatic encoding of Clojure values into bytes
- No automatic decoding of bytes into Clojure values
- No TLS support
- No Redis Cluster support
- Does not support the
MONITOR
command
If you have ideas on how to improve Rad's performance (sequential performance in particular) or the performance of the RESP3 implementation (apart from writing it in Java), I'd be interested in hearing about them.
Other than that, I'm not accepting code contributions at this time. If you have improvement ideas, bug reports, or feature requests, file an issue.