Skip to content

Welcome to Kotlin-valkey

Kotlin-valkey is a Valkey 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
  • ✅ Valkey 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 Valkey command is missing
  • ✅ Keeps track of Valkey restarts - useful for detecting potential data loss in your app

Getting started

Continue to the quick start guide.

JavaDocs

JavaDocs

Prerequisites and compatibility

  • JDK 25 or higher
  • Not implemented yet (but easy to add yourself):
    • Cluster
    • Valkey streams