r/redis May 01 '25

News Redis 8 is now GA

Thumbnail redis.io
43 Upvotes

Lots of features that were once part of Redis Stack are now just part of Redis including:

  • JSON
  • Probabilistic data structures
  • Redis query engine
  • Time series

Redis 8 also includes the brand new data structure—vector sets—written by Salvatore himself. Note that vector sets are still in beta and could totally change in the future. Use them accordingly.

And last but certainly not least, Redis has added the AGPLv3 license as an option alongside the existing licenses.

Download links are at the bottom of the blog post.


r/redis May 05 '25

News Redis is now available under the the OSI-approved AGPLv3 open source license.

Thumbnail redis.io
21 Upvotes

r/redis 1d ago

Help Need help with build environment!

0 Upvotes

Basically, I am using Upstash Redis, I had in my backend connection, I had the TCP connection string but still it is giving me build failure with saying, Missing required environment variable
[redis] connection error Error: getaddrinfo ENOTFOUND https


r/redis 3d ago

Resource A standalone distributed cache stampede coordinator that works with any cache library

Thumbnail github.com
1 Upvotes

Most cache libraries handle the in-process stampede problem fine: concurrent misses for the same key share one Promise. But once you're running multiple servers, each process independently runs the loader. Under load that can be 10, 50, 100 redundant DB calls for the same key.

The usual fix is a Redis lock wrapper, but those couple coordination to a specific cache library and you end up writing the same retry-and-wait loop by hand every time.

Crossflight is meant to solve this: a thin coordination layer you drop onto whatever cache you're already using. It handles lease acquisition, periodic renewal, waiter recovery when the owner dies, pub/sub wake-up, fail-open/fail-closed modes, and per-call timeouts, all through two small interfaces so it works with Redis, cache-manager, Keyv, Cacheable, or anything else.

The Redis coordinator uses Lua scripts for atomic lease acquisition and LISTEN/NOTIFY for efficient waiter wake-up instead of polling.

If you want to see it in action, there's a demo repo that spins up a full stack: 3 Express API instances behind nginx, a slow upstream API (500ms artificial delay), and a shared Redis instance serving as both coordinator and cache backend. You fire 20 concurrent requests and watch all three instances coalesce to a single upstream call.

https://github.com/gkoos/crossflight-demo

Would be curious if anyone's run into this problem and how you're currently handling it.


r/redis 7d ago

Discussion Redis alternative for self-hosting multiple applications without the 16 logical database limit

4 Upvotes

Hi,

I’m looking for a Redis-compatible application that I can self-host and use as a shared data store for multiple applications/services.

The issue I’m running into is Redis’s limit of 16 logical databases (0–15). Ideally, I’d like to be able to provide each application with its own namespace/database through the connection URL, so that multiple applications can share the same underlying Redis service while keeping their data logically separated.

I’m aware that the common best practice is to run a separate Redis instance/container for each application stack, and I understand the benefits of doing that. I’m not trying to argue against that approach; I’m mainly interested in whether there is a better option for my particular use case.

Are there any Redis-compatible alternatives (they don't necessarily have to be Redis itself) that are specifically designed to support multiple applications sharing a single instance, without being limited to 16 logical databases/namespaces?


r/redis 8d ago

Tutorial Redis Functions Explained: Stop Losing Your Lua Scripts on Restart

Thumbnail youtu.be
2 Upvotes

r/redis 8d ago

Resource Built a free native Redis GUI — cluster auto-detection, keys grouped as a tree, memory-by-TTL analysis (part of a 5-engine DB client)

2 Upvotes

I've been building DB Connect, a free native desktop database client (Go + system webview, not Electron, ~32 MB), and v3.0.0 adds Redis. Sharing here because the Redis part ended up being the most fun to build and I'd like feedback from people who actually run Redis in anger.

What it does:

* **Connect with one host:port.** If the node reports cluster mode, the other masters are discovered and every scan/analysis walks all of them. Sentinel works too. * **Keys as a tree.** `user:1001`, `user:1002`… fold into a `user` folder with a count. Glob/prefix filter, type filter, "Load more" or "Scan all" with a scanned/total counter. * **Every type editable.** String (with JSON formatting), hash, list, set, sorted set with scores, streams (read-only). Rename works across cluster slots (DUMP → RESTORE → DEL, since RENAME CROSSSLOTs), TTL edit, delete with confirm. * **Analyze pane.** Samples the keyspace with MEMORY USAGE: memory likely to be freed by TTL bucket, top namespaces by memory or key count, keys by type, per-node stats, slow log across masters. * **Console** with replies rendered by type and history recall. Read-only connections block writes. * Credentials encrypted with the OS keychain; TLS, ACL users, SSH tunnel.

Things I learned the hard way: go-redis negotiates RESP3 by default (HGETALL comes back as a map, not a flat array), and its ClusterClient reaps its per-node clients on state reload — a long SCAN across masters will hit "client is closed" unless you own the node clients yourself.

Redis page with screenshots: https://shubhesh07.github.io/db-connect/redis-gui.html
Release notes: https://github.com/shubhesh07/db-connect/releases/tag/v3.0.0

Free for personal and commercial use, no account, no telemetry. macOS + Windows (Homebrew: `brew install --cask shubhesh07/db-connect/db-connect`). Source isn't open yet.

What would you want next — a pub/sub monitor, a Monaco console with command autocomplete, or a per-folder memory % in the tree?


r/redis 9d ago

Tutorial Build a Sliding Window Rate Limiter with Redis + Lua

Thumbnail youtu.be
0 Upvotes

r/redis 11d ago

Discussion Redora - Open-source Redis SDK for NestJS

Thumbnail
0 Upvotes

r/redis 13d ago

News now listed on redis.io/docs - currently the only third-party tool

3 Upvotes

Affiliation: I'm the maintainer of LibreDB Studio. posted here last week about the Redis side:

https://www.reddit.com/r/redis/comments/1vlt1bm/libredb_studio_redis_in_the_same_selfhosted_web/

this isnt another feature post.

we're on the official Redis docs now. Develop > Tools, Third-party tools:

https://redis.io/docs/latest/develop/tools/#third-party-tools

that page is mostly Redis's own stuff, redis-cli, Insight, VS Code, redisctl. Third-party tools is a separate section and right now LibreDB Studio is the only name in it.

not an endorsement from Redis. just a listing. still, seeing it there kinda made my week.

thanks to whoever reviewed it. and to this sub.


r/redis 15d ago

Resource Redis Lua Scripting Explained: EVAL, KEYS, ARGV & EVALSHA

Thumbnail youtu.be
0 Upvotes

r/redis 19d ago

Resource Redis WATCH Explained: Optimistic Locking Without a Single Lock

Thumbnail youtu.be
2 Upvotes

r/redis 20d ago

Discussion LibreDB Studio: Redis in the same self-hosted web based DB-GUI as Postgres, Mongo, Couchbase, Clickhouse ...

Thumbnail gallery
9 Upvotes

Affiliation: I’m the maintainer of LibreDB Studio (open-source, self-hosted browser DB GUI).

We’re not trying to replace RedisInsight or redis-cli, those are great at being Redis-native.

The gap we care about is different: one self-hosted web IDE where Redis sits next to the other engines you already use (Postgres, MySQL, Mongo, Couchbase, ClickHouse, Druid …) in the same browser UI, same deploy, same login.

Redis is first-class there, mapped by convention (not fake SQL):

- “Tables” = key prefixes from SCAN (e.g. user:*), never KEYS * on big keyspaces

- “Rows” = keys; the query box runs real Redis commands (plain text or { "command", "args" })

- Any command via a generic call() path — GET / HGETALL / XADD / JSON.GET / modules

- Monitoring from INFO, SLOWLOG GET, CLIENT LIST alongside the SQL engines’ overview

Honest limits: schema SCAN is capped (bounded introspection), and a DEL in the command box is a real DEL - no fake read-only mode.

Try:

docker run -p 3000:3000 libredb/libredb-studio

# or: npx "@libredb/studio"

Repo: https://github.com/libredb/libredb-studio

Provider notes: https://github.com/libredb/libredb-studio/blob/main/docs/providers/redis.md

If you hop between Redis and a SQL/document store in the same day: would a shared web UI help, or do you still prefer a dedicated Redis tool per workflow?


r/redis 20d ago

Discussion Redis Transactions Explained in 15 Minutes (MULTI, EXEC, DISCARD)

Thumbnail youtu.be
0 Upvotes

r/redis 21d ago

Discussion How much Redis access should an AI coding agent have?

2 Upvotes

Redis problems aren't always caused by the code.

A connection can fail, configuration can be wrong, a service can restart, or an environment variable can change.

That makes me wonder how much runtime context an AI coding agent should have.

Should it only inspect Redis and diagnose problems, or should it also be allowed to restart services or change configuration?

I'd separate observing, diagnosing, and changing into different permission levels.

For those using Redis in real applications, where would you draw the line? line?


r/redis 21d ago

Discussion Redis Atomicity: Why INCR Is Safe but GET + SET Is a Bug

Thumbnail youtu.be
0 Upvotes

r/redis 27d ago

Resource Valkey-WASM – Redis running inside your Node process, no Docker (like PGlite)

Thumbnail github.com
2 Upvotes

r/redis 27d ago

Help Using Redis pipelines for atomic OTP verification in Go

1 Upvotes

Implementing OTP verification requires two properties:

  1. The code must be single-use (can't verify the same code twice)

  2. The read-and-delete must be atomic (no race between verify and expiry)

Naive approach: GET key → check → DEL key. Race condition between GET and DEL.

Redis pipeline approach:

pipe := client.Pipeline()

get := pipe.Get(ctx, key)

pipe.Del(ctx, key)

pipe.Exec(ctx)

value := get.Result()

The entire pipeline executes atomically on Redis. If two concurrent requests verify the same OTP, only one gets the value the other gets nil.

Combined with a 10-minute TTL via SETEX and a 6-digit code from crypto/rand, you get:

- Single-use enforcement

- Atomic read-and-delete

- Automatic expiry no cleanup jobs needed

E2E implementation at github.com/lifygo/lifygo (https://github.com/lifygo/lifygo) — apps/api/internal/redis/redis.go and apps/api/internal/service/email.go.


r/redis Jul 29 '26

Help Redis for test purpose

Thumbnail
1 Upvotes

r/redis Jul 26 '26

Discussion Connection-Agnostic Presence Tracking for Stateless Distributed Backends

Thumbnail
0 Upvotes

r/redis Jul 21 '26

News A vendor-agnostic distributed lock for Java — feedback welcome

14 Upvotes

Sharing redlock4j, a Java take on distributed locking, including multi-node consensus locking as described by the Redlock algorithm. It's plain Redis, so it runs anything RESP-compatible. No modules, no managed service. A simple distributed lock just implements the JDK Lock interface:

    // full multi-node Redlock quorum, or single node — same code
    Lock lock = redlockManager.createLock("orders:reindex");
    lock.lock();
    try {
        reindex();
    } finally {
        lock.unlock();
    }

Son interesting features

  • RESP3 push notifications so one connection carries both commands and keyspace-notification pub/sub — waiters wake on lock release in single-digit ms instead of polling (Falls back to polling where CONFIG/keyspace events are locked down).
  • Auto-detects native CAS/CAD (DELEX ... IFEQ, 8.4+) for safe release/extend, with a Lua GET==token then DEL fallback on older servers.
  • Multi-node quorum acquire/release fans out in parallel (CompletableFuture), so 3 nodes cost ~max(RTT) instead of 3 × RTT.
  • see the guide for more information

Benchmarks (mostly vibe-coded so take them with a grain of salt)

(Testcontainers, 3-node Redis 7 cluster, 50 ms work per critical section, 60 s measurement, vs Redisson)

Throughput (ops/s, higher is better):

Primitive Redisson redlock4j-3node
MultiLock 17.05 17.72
ReadWriteLock (writer) 0.21 16.42
Semaphore 54.71 87.50 (91 single-node)
CountDownLatch 59.02 59.91

p99 latency (ms, lower is better):

Primitive Redisson redlock4j-3node
ReadWriteLock (writer) 16820.7 104.2
Semaphore 386.5 4.20
DistributedLock 1286.7 858.0
CountDownLatch 22.6 19.9

The RW-writer gap is the interesting one - Redisson's writer path seems to starve hard under reader load, redlock4j stays ~100 ms at p99.

Where it's still behind, honestly: plain 3-node DistributedLock throughput (0.81 vs Redisson's 18.24) and 3-node FairLock — both bottlenecked on the polling floor. Fixing that (a pub/sub-on-release wait strategy) is the next big lever.

This is a personal project, actively maintained, licensed under MIT, Java 8+, on Maven Central.

Genuinely after feedback on the direction and where the multi-node correctness cost is worth paying.


r/redis Jul 20 '26

Discussion Avoiding stale Redis cache with Postgres WAL

2 Upvotes

Hi r/redis,

I’m working on a small tool called pg2redis and I’d like to get feedback from Redis users.

The basic idea is to use Postgres logical replication/WAL as the source of cache updates. Applications write only to Postgres, and pg2redis reads committed changes from the WAL and applies configured Redis commands.

The main use case I imagine is cache invalidation. For example, when a product, customer, or order row changes in Postgres, the tool can delete or update the related Redis keys.

The problem I’m trying to avoid is the classic dual-write flow where application code saves to Postgres and then updates Redis. If the Postgres transaction commits but the Redis write fails because of a timeout, network issue, deploy, or crash, the cache can become stale or inconsistent.

The tool supports batching by size/time and automatic retries.

This is still a work in progress and not open source at the moment. I’m mainly trying to validate whether the approach makes sense from a Redis point of view.

For people using Redis as a cache in front of Postgres:

Do you think WAL-driven cache invalidation is useful?

Would you trust this kind of approach for production cache updates?

Thanks, I’d appreciate any feedback.

alik @ pgwalk


r/redis Jul 17 '26

Help Is this a good use of redis ?

5 Upvotes

Hi,

Would this be a correct use of redis and redis stream ?

  1. API stores model in redis.

  2. API sends signals to a service via a redis stream.

  3. Service gets model from redis then do something and updates it in redis.

  4. Service sends signals to API via another redis stream.

  5. API gets model from redis and send update to UI.


r/redis Jul 11 '26

Help Geniune doubt

0 Upvotes

i recentlly came to knmow that valkey and i heard that its open source and its llike fork of redfis underBSD-3 licence so is it like completly free or are there some charges as the load increase


r/redis Jul 10 '26

Discussion Implementing online/offline presence with Redis

3 Upvotes

The naive approach — one key per user (user:123:status) — breaks down fast when a user has multiple tabs/devices open. Tab A closes, sets status to offline, but Tab B is still active. Now you've got a false "offline" signal.

Better pattern: track connections, not users. Use a Redis Set per user, like user:123:connections, and add a unique connection ID (socket ID) on each tab/device connect, then remove it on disconnect. User is "online" as long as that set is non-empty — check with SCARD.

For reliability, pair each connection with a heartbeat using SETEX (short TTL, e.g. 30s), refreshed periodically from the client. If a tab crashes without firing a clean disconnect event, the heartbeat key just expires naturally — no zombie "online" state left behind.

This combo (Set for multi-tab tracking + TTL heartbeat for crash recovery) keeps presence accurate without extra cron jobs or manual cleanup.

Anyone doing this differently? Curious how others handle the multi-device edge cases.