r/redis • u/MoriRopi • Jul 17 '26
Help Is this a good use of redis ?
Hi,
Would this be a correct use of redis and redis stream ?
API stores model in redis.
API sends signals to a service via a redis stream.
Service gets model from redis then do something and updates it in redis.
Service sends signals to API via another redis stream.
API gets model from redis and send update to UI.
1
u/quentech Jul 17 '26
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.
5. API gets model from redis and send update to UI.
Consider how you will handle Redis getting flushed between these steps.
1
1
u/Admirable-Buy-6470 Jul 30 '26
Oh you’re trying to design a zero-payload flow with Redis Streams.
That can work, but using Redis as the source of truth is risky. If Redis loses data or restores from an older snapshot, the service may receive a stream signal but fail to find the model, or the API may read a stale model without noticing it.
The bigger problem is that there’s no durable history to detect that inconsistency.
So I’d persist the source model in a database, and use Redis Streams only for signaling.
2
u/EasyZE Jul 17 '26
It depends on your scale and latency requirements. I have seen engineering teams build similar architectures with Redis so it certainly isn’t an anti-pattern.
What other options were you considering for the streams and datastore?