Integrating with Redis cache
In a distributed cloud application with a fine-grained microservice architecture, distributed caching can provide much-desired data coherence, as well as performance improvements. Generally speaking, the distribution of the infrastructure, the data model, and costs are deciding factors regarding whether to use a distributed cache implementation.
ASP.NET Core offers various caching options, one of which is distributed caching. The available distributed cache options are as follows:
- Distributed memory cache
- Distributed SQL server cache
- Distributed Redis cache
While the memory cache is not a production-ready strategy, SQL and Redis can be viable options for a cloud application that's been developed with .NET Core. However, in the case of a NoSQL database and semi-structured data, Redis would be an ideal choice. Let's see how we can introduce a distributed cache and make it ready for use:
- In order to introduce a distributed...