Welcome to Kotlin-redis
Kotlin-redis is a Redis library for Kotlin. It focuses on low footprint, performance and openness/extensibility.
Highlights
- ✅ Zero dependencies (except for SLF4J) - pure JDK/Kotlin code
- ✅ Streaming-first client, does not hold values in memory (InputStream for data transfer).
- String/ByteArray based API is provided purely as extension functions (buffer limit and charset configurable)
- ✅ Pipelining-first, for better performance, saving unnecessary round trips
- Non-pipeline (direct request/response) API is provided purely as extension functions on top
- ✅ Binary safe
- ✅ Redis transactions support
- ✅ Async SUBSCRIBE/PUBLISH support
- ✅ Developer friendly synchronous code, use VirtualThreads for scaling
- ✅ Connection pool included
- ✅ TLS support incl. mTLS (see TLS)
- ✅ Easily extendable if your favourite Redis command is missing
- ✅ Keeps track of Redis restarts - useful for detecting potential data loss in your app
- ✅ RedisLockService: distributed lock service (multiple locks, reentrant, auto lease renewing and deadlock detection)
Getting started
Continue to the quick start guide.
JavaDocs
Prerequisites and compatibility
- JDK 25 or higher
- Redis 6.2 or newer (only speaks RESP3 which has been available since 2020 - time to let go)
- Not implemented yet (but easy to add yourself):
- ACL/AUTH
- Cluster
- Redis streams