Skip to content

Unified Redis Platform is a solution for consolidating multiple Redis Caches to a single cluster. The cluster can be shared by multiple apps but provides proper isolation to each application. This is the client-side core SDK for Unified Redis Platform.

License

Notifications You must be signed in to change notification settings

microsoft/UnifiedRedisPlatform.Core

Repository files navigation

Unified Redis Platform (URP)

Motivation

With the increase of Cloud Adoption, cost optimization has become a concern for organizations moving to the Cloud. Upon conducting a cost analysis of our Azure Subscriptions, we realized that Azure Caches for Redis were among the highest sources of expenditure. In our ecosystem of Micro-services, each service was using its own isolated Redis Cache for each environment. This is the same of many services and ecosystem across the industry. Furthermore, if you need to satisfy your customer demands of BCDR (Business Continuity Disaster Recovery), you might create replica Redis Caches in alternate regions. In most cases, we analyzed that these Caches were not used up to their full potential (both in terms of load and storage). Our analysis concluded that we were using about 1GB of the P1 Redis Caches. A single P1 cache can store 6GB of data. A single P1 Redis Cache costs around $412 per month. With three micro-services and each service is utilizing two Redis Caches were spending about $2,412 per month.

Such an analysis motivated us to look for opportunities to merge the existing Redis Caches into a single cluster shared by the existing applications. Still, it needed to ensure that each application had proper isolation.

This platform allows multiple application to re-use a single or a cluster of Redis Caches. The platform provides proper isolation required by various apps to operate (get/edit/delete/update cached objects) on a single cluster without interfering (key overrides) with each other.

Capabilities

  1. Consolidate multiple Azure Cache for Redis instances to a single cluster
  2. Automatic key name-spacing for providing isolation between multiple applications
  3. Disaster Recovery by keeping Azure Redis Cache in multiple regions in a single cluster
  4. Multiple read-regions
  5. Geo-replication of data (add/delete/update) across multiple regions
  6. Support for all operations available in StackExchange.Redis library. You can use all methods and data types from StackExchange.Redis without any code change.
  7. Support for auto-retires and timeouts in case of errors
  8. Automatic lazy and singleton connection for preventing connection exhaustion issues
  9. Secure connection using application-specific private Keys
  10. Telemetry support for Redis Key usage, performance reports and failures
  11. Management console for managing keys from backend

Status

CI

Release

Release-Extension-DistributedCache

Build Status

Nuget

Nuget

Getting Started

Install the latest version of the core URP SDK package - UnifiedRedisPlatform

Install-Package UnifiedRedisPlatform

Connect with Redis Cluster by creating a IUnifiedConnecionMultiplexer

IUnifiedConnectionMultiplexer connectionMux = UnifiedConnectionMultiplexer.Connect("Cluster ID", "App ID", "App Secret", preferredLocation: "Location")

Create a IDatabase to interact with the Redis Cache Database. The IDatabase interface is exposed by StackExchange.Redis library.

IDatabase _database = _mux.GetDatabase();

All methods exposed in IDatabase is available in URP

await _database.StringSetAsync(keyName, value);
string value = await _database.StringGetAsync(keyName);

See more details in the WiKi

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

About

Unified Redis Platform is a solution for consolidating multiple Redis Caches to a single cluster. The cluster can be shared by multiple apps but provides proper isolation to each application. This is the client-side core SDK for Unified Redis Platform.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published