Valkey GLIDE for Rust (glide)
A first-class, native Rust client for Valkey and Redis OSS,
built directly on the shared glide-core engine that powers the official
GLIDE clients for Python, Java, Node, and Go.
Because glide-core is itself written in Rust, this wrapper links to it
directly — no FFI, no socket bridge — making it the thinnest and fastest
GLIDE binding.
Highlights
- Async first —
GlideClient(standalone) andGlideClusterClient(cluster) built on Tokio. - Blocking API — a
synclayer mirrors the async surface for non-async code (enabled by the defaultsyncfeature). - Broad command coverage — typed methods across strings, generic/key, hash, list, set, sorted-set, HyperLogLog, bitmap, geo, stream, scripting, connection- and server-management, plus batches/transactions.
custom_commandescape hatch — run any command (with optional cluster routing) even where a typed wrapper is not provided, guaranteeing 100% functional coverage.- Batching —
pipe()pipelines andMULTI/EXECtransactions, executed typed viaquery_async(zero extra payload copies) or with GLIDE execution controls (PipelineOptions: per-call timeout and pipeline retry strategy) viaexec. - Dynamic authentication — rotate the connection password at runtime with
update_connection_password, or use AWS IAM auth (ElastiCache / MemoryDB) viaServerCredentials::iam. - Runtime Pub/Sub —
subscribe/psubscribe/ssubscribe(and the matching unsubscribes) in addition to connect-time subscriptions; messages arrive viaget_pubsub_message. - OpenTelemetry — export traces and metrics via the
glide::telemetrymodule (gRPC / HTTP / file exporters). - Feature parity with the Python GLIDE wrapper as the baseline for the API surface.
Documentation
GLIDE concepts — cluster routing, batching, the PubSub model, multi-slot command handling, and OpenTelemetry — are shared with the official clients and documented at glide.valkey.io; this client is built on the same core, so those concepts apply here unchanged. For Rust-specific architecture see DESIGN.md.
Supported Engine Versions
The compatibility target matches GLIDE — see the
Supported Engine Versions table.
It is tested on Linux (x86_64 and aarch64). Other platforms (e.g. macOS)
should work wherever glide-core builds, but are not tested yet.
Installation
Prerequisites
- Rust — Install via rustup.
- A running Valkey (or Redis OSS) server to connect to — e.g.
valkey-serverlocally,docker run -p 6379:6379 valkey/valkey, or an ElastiCache/MemoryDB endpoint.
Add the dependency
The package is named valkey-glide and the library is imported as glide.
The async client is built on Tokio, so you will also need a Tokio runtime:
The first build compiles glide-core and its dependency tree, so it takes a
few minutes; subsequent builds are incremental.
Quick start (async)
use ;
async
Quick start (sync)
use SyncGlideClient;
use ;
Cluster & routing
use ;
# async
Migrating from redis-rs
GLIDE's command API mirrors redis-rs 1.7.0, so most call sites migrate with only import and type-name changes. See migration.md for more details.
Getting Help
- GitHub Issues: Check the existing issues first; if your question or problem isn't covered, open a new issue.
- Valkey Slack: For questions about Valkey or GLIDE in general, join the Valkey Slack.
Contributing
Contributions are welcome — bug reports, feature requests, and pull requests. See the Contributing Guidelines to get started and DEVELOPER.md for the development workflow.
License
Licensed under the Apache License, Version 2.0. See the
LICENSE
for the full text.