So I was seeing a video in youtube about redis use case for a specific scenarios or a system design. So I am writing down my understanding of those use-cases
The key redis use-cases are being used in the video
They were explaining how they integrated redis in their system in multiple layer as explaining their's system workflow.
cachedthe db queries in redis.
- Then when a user requests a query it
queuesin redis and a consumer consumed the request and start processing for the query.
- Before starting the query they
lockedthe user request so that his further requests are not being processed by other consumers. If another consumer fails to
locka query(means it is already being locked) they
re-queuethe query again with fibonacci series seconds.
- After they get a response from the db they generate the
cachefor the query and send back the request to redis by publishing(
pubsub) it and on the other side the web server was listening(
pubsub) for the response in the redis(it started listening right after it made the request to that service). When it gets back the result it responds back to the client.
The original Link can be found here, 5 Redis Use Cases with Gur Dotan