Skip to main content

Posts

Showing posts with the label Redis Cahe

Use Azure Cache For Redis In AspNetCore Application Using Distributed Cache Technique[.NET6]

In this article, we are going to do a small demo on integrating Azure Redis Cache into the AspNetCore Application using Distributed cache technique. Redis Cache: Redis is an open-source in-memory data structure store, used as a database, cache. It supports data structures such as strings, hashes, lists, sets, stored sets with range queries, etc. Let's understand the flow of Redis cache in a web application: Users request a page from the web application. Web application queries the Redis store, if the data exists, then fetches the data and returns the response directly to the user. If no data is in the Redis store, the application queries the database and fetches the data, next save the same data into the Redis store so that subsequent user request can consume the data from the Redis store directly, finally returns the response to the users. Create A Azure Redis Cache: Step:1 Create and sign-in into the Azure portal(https://portal.azure.com/) Step:2 On the Azure portal home page

Use Redis Cache In NestJS Application

Redis Cache: Redis is an open-source in-memory data structure store, used as a database cache. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, etc. Caching can significantly improve application performance and its scalability by reducing the workload to generate the content. If our server application runs on multiple servers then it is easy to share the Redis Cache between them. Setup Redis Docker Image Container: For this sample to use Redis instance locally we will use Docker. If you don't have any prior knowledge of docker, not a problem just follow the steps below.  Click here for a video session on Redis docker setup Note: Skip this section if you already have redis direct instance or azure or any cloud provider that have redis Step1: Download docker into our local system "https://docs.docker.com/desktop/" . Docker was available for all desktop operating systems. Step2: After downloading the docker installer, t