Overview
Valkey is an open-source fork of Redis designed to provide a seamless and reliable alternative to Redis OSS. With Aiven for Valkey, you can leverage high-performance in-memory data storage for caching, session management, real-time analytics, and more.Why Choose Aiven for Valkey
Open Source
Licensed under permissive BSD-3 license, ensuring open-source availability and freedom
Redis Compatible
Fully compatible with Redis OSS 7.2.4 for seamless migration
High Performance
In-memory data store with microsecond latency for real-time applications
Rich Data Structures
Strings, hashes, lists, sets, sorted sets, bitmaps, hyperloglogs, and streams
Key Features
Data Structures
Data Structures
Valkey supports multiple data structures:
- Strings: Simple key-value pairs
- Hashes: Field-value pairs (like objects)
- Lists: Ordered collections
- Sets: Unordered unique collections
- Sorted Sets: Ordered sets with scores
- Bitmaps: Bit-level operations
- HyperLogLogs: Probabilistic counting
- Geospatial: Location-based data
- Streams: Log-like data structures
High Availability
High Availability
Built-in replication and failover:
- Primary-replica replication
- Automatic failover
- Sentinel for monitoring
- Persistence options (RDB, AOF)
- Business and Premium plans
Pub/Sub Messaging
Pub/Sub Messaging
Real-time messaging capabilities:
- Channel-based messaging
- Pattern-based subscriptions
- Message broadcasting
- Event-driven architectures
Lua Scripting
Lua Scripting
Server-side scripting:
- Atomic operations
- Complex logic execution
- Reduced network overhead
- Custom commands
Persistence
Persistence
Durable data storage options:
- RDB: Point-in-time snapshots
- AOF: Append-only file logging
- Automatic backups every 24 hours
- Configurable retention periods
Getting Started
1
Create Valkey Service
Deploy a Valkey service:
2
Get Connection URI
Retrieve connection details:Format:
valkeys://default:password@host:port3
Connect with CLI
Using valkey-cli or redis-cli:
4
Run Commands
Connection Examples
- Python
- Node.js
- Go
- Java
Common Use Cases
- Caching\
- Session Storage
- Rate Limiting
- Real-Time Analytics
- Job Queues
- Pub/Sub
Improve application performance with caching:
Performance Tips
Connection Pooling
Connection Pooling
Use connection pools to reuse connections:
Pipelining
Pipelining
Batch multiple commands:
Efficient Data Structures
Efficient Data Structures
Choose the right data structure:
- Use hashes for objects (more memory efficient than multiple keys)
- Use sorted sets for rankings
- Use bitmaps for boolean flags
- Use HyperLogLog for approximate counting
Key Expiration
Key Expiration
Set expiration to manage memory:
Monitoring and Maintenance
Key Metrics
Performance
- Operations per second
- Hit rate
- Latency (avg, p95, p99)
- Network throughput
Memory
- Used memory
- Memory fragmentation
- Evicted keys
- Key count
Replication
- Replication lag
- Connected replicas
- Replication offset
Connections
- Connected clients
- Blocked clients
- Connection errors
Monitoring Commands
Migration from Redis
1
Compatibility Check
Valkey is fully compatible with Redis OSS 7.2.4. Most applications work without changes.
2
Update Connection Strings
Simply point your application to the new Valkey service URI.
3
Test Your Application
Verify all functionality works as expected with Valkey.
4
Monitor Performance
Compare performance metrics to ensure expected behavior.
Related Services
Apache Kafka
Use Valkey for Kafka consumer offset caching
PostgreSQL
Cache PostgreSQL query results in Valkey
Grafana
Monitor Valkey metrics in Grafana
Dragonfly
Alternative in-memory store for higher scale
Resources
Redis Compatibility: Valkey is fully compatible with Redis OSS 7.2.4, ensuring a smooth transition for existing Redis applications.