Working
Redis acts as a caching layer between the database and the client to speed up data access and reduce the load on the main database.
When a client asks for data, the API Gateway forwards the request to Redis.
Request Handling: The client request is routed through the API Gateway, which first checks Redis for the required data.
Cache Hit: If the data exists in Redis, it is returned immediately without accessing the database.
Cache Miss: If the data is not found in Redis, the request is forwarded to the main database.
Cache Update: The data retrieved from the database is stored in Redis for future requests.
Response to Client: The API Gateway sends the final response to the client using data from Redis or the database.
Example: When a user visits a popular product page, Redis serves the cached product information instantly instead of querying the database every time.











