DEV Community

Alex Spinov
Alex Spinov

Posted on

Valkey Has a Free Redis Alternative — In-Memory Data Store With Full Redis Compatibility

When Redis changed its license in March 2024, the community forked it. The result: Valkey — a Linux Foundation project with backing from AWS, Google, Oracle, and dozens of contributors.

If you're starting a new project that needs an in-memory data store, Valkey gives you everything Redis did, with a truly open-source license.

What You Get Free

Valkey is BSD-3 licensed. Free forever, no license traps:

  • 100% Redis compatible — all Redis commands, protocols, and clients work
  • In-memory key-value store — sub-millisecond reads and writes
  • Data structures — strings, lists, sets, sorted sets, hashes, streams, bitmaps
  • Pub/Sub — real-time messaging between services
  • Lua scripting — atomic server-side logic
  • Clustering — horizontal scaling across multiple nodes
  • Persistence — RDB snapshots + AOF for durability
  • Replication — primary-replica for high availability
  • Modules — extend functionality (search, JSON, time series)
  • ACLs — user-based access control

Quick Start

# Docker
docker run -d -p 6379:6379 valkey/valkey:8

# Or build from source
git clone https://github.com/valkey-io/valkey
cd valkey && make && make install
valkey-server
Enter fullscreen mode Exit fullscreen mode

Connect with any Redis client:

redis-cli -h localhost -p 6379
> SET hello "world"
> GET hello
"world"
Enter fullscreen mode Exit fullscreen mode

Real Example: Session Store with Node.js

import { createClient } from 'redis';

const client = createClient({ url: 'redis://localhost:6379' });
await client.connect();

// Session management
await client.set('session:abc123', JSON.stringify({
  userId: 42, role: 'admin', loginAt: Date.now()
}), { EX: 3600 }); // expires in 1 hour

const session = JSON.parse(await client.get('session:abc123'));

// Rate limiting
const key = 'rate:192.168.1.1';
const requests = await client.incr(key);
if (requests === 1) await client.expire(key, 60);
if (requests > 100) console.log('Rate limited!');

// Pub/Sub
await client.subscribe('notifications', (message) => {
  console.log('Received:', message);
});
Enter fullscreen mode Exit fullscreen mode

What You Can Build

1. Session store — fast session management for web apps. Replaces database sessions.
2. Cache layer — reduce database load by 90%. Cache API responses, query results.
3. Rate limiter — IP-based or token-based rate limiting in 5 lines of code.
4. Job queue — BullMQ, Celery, Sidekiq all work with Valkey. Background job processing.
5. Real-time leaderboard — sorted sets for rankings. Gaming, analytics, competitions.

Why Valkey Over Redis

License: BSD-3 (truly free) vs Redis Source Available License (RSAL). No usage restrictions with Valkey.

Governance: Linux Foundation project. Community-driven, not single-company controlled.

Compatibility: Drop-in replacement. Change your connection string. Everything else stays the same.


Need data infrastructure help? Email spinov001@gmail.com

More free tiers: 53+ Free APIs Every Developer Should Bookmark

Top comments (0)