Search code examples
.net-coreazure-cachingazure-app-configuration

Caching App Configuration values in Azure Cache for Redis


I run a .NET Core application running on 5 Azure App Service instances.

I am going to migrate my configuration to Azure App Configuration, where the SDK (NuGet package) caches the values in-memory for a specified time (i.e. 30 minutes).

Considering the life-cycle of an instance, is this in-memory caching recommended over caching the values in Azure Cache for Redis?


Solution

  • At a high level, both Azure App Configuration and Azure Cache for Redis are key-value storage, but they are tailored and optimized for different scenarios. You may evaluate based on your need.

    Azure App Configuration is for configuration scenarios. Here are a few things it offers:

    • Tools to help import/export configuration.
    • Support for GitHub action and Azure Pipelines to integrate App Configuration in your CI/CD.
    • Revision history to track changes and restore changes in case anything goes wrong.
    • Client libraries to use App Configuration just as another configuration source to your app, so the code change to your app is minimal.
    • Integration with other Azure services like App Service for configuration scenarios.

    Azure Cache for Redis is for distributed caching scenarios. You have your dedicated deployment. Your data may be changed frequently, but you don't really care about the history of changes.