Hi everyone,
I wanted to share that valkey 0.2.0 is now on opam:
- opam: opam - valkey.0.2.0
- Repo and Getting Started: ocaml-valkey/docs/getting-started.md at main · avifenesh/ocaml-valkey · GitHub
The main thing I wanted with this project was to focus on the current Valkey stack with the newer OCaml stack.
So valkey is built around:
- OCaml 5
- Eio-native direct-style concurrency
- RESP3 only
- Modern Valkey features and real cluster behavior
A few parts I’m happy with:
-
Cluster support with a strong focus on durability and high availability:
topology refresh, periodic background refresh,MOVED/ASK/CLUSTERDOWNhandling, replica-aware reads, AZ-aware routing, and failover-aware sharded pub/sub replay -
connection/runtime behavior:
circuit breaker, reconnect handling, keepalive, TLS, and optional separation between socket I/O and parsing viaEio.Domain_manager, so one side of the system does not block the other -
batch support:
scatter-gather across slots, atomic single-slot flows withWATCH/MULTI/EXEC, multi-slot helpers, and in
0.2.0also WATCH guards for read-modify-write CAS plus cross-slotpfcount_cluster -
command surface:
typed helpers across a pretty broad set of commands,Client.custom/custom_multifor custom commands and multi-node execution, and named commands so you can register command templates once and reuse them later -
scripting:
local script caching and optimisticEVALSHAhandling with automatic fallback/retry onNOSCRIPT, so callers don’t need to manage that flow themselves
There is also already a pretty good amount of validation around it:
integration tests, property tests, fuzzing, chaos testing, examples, and guides.
Performance-wise, it also came out pretty nicely: in several scenarios it gets to 90%+ of the C reference client.
opam update
opam install valkey eio_main
Current next steps on the roadmap are things like:
- client-side caching
- connection pools / blocking pools
IAM+mTLS- Valkey module support (JSON, search, bloom)
If there’s a feature people care about, I’d be very happy to reprioritize the roadmap around real interest.
I’d also really love feedback from the OCaml community on the API, ergonomics, docs, and general design.
I’m very familiar with the Valkey world, but OCaml is more of a side fun for me than my daily language, so feedback from people who really live in the OCaml ecosystem is especially valuable to me.
If you try it, I’d love to hear what you think.