Code Monkey home page Code Monkey logo

microsoft / unifiedredisplatform.core Goto Github PK

View Code? Open in Web Editor NEW
11.0 6.0 0.0 1.08 MB

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: MIT License

C# 98.12% HTML 1.28% CSS 0.60%
redis microsoft azure azure-cache-redis cost-optimization cloud-optimization urp

unifiedredisplatform.core's Introduction

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.

unifiedredisplatform.core's People

Contributors

karsub-microsoft avatar microsoft-github-operations[bot] avatar microsoftopensource avatar patrickcode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

unifiedredisplatform.core's Issues

Pattern Issue

pattern search in

Task<IEnumerable<RedisKey>> GetKeys(string pattern = "");

in file - IDistributedUnifiedRedisCache is case sensitive.
For example - if I send keyword then any key which has KeyWord sub-string in it wont be returned as it doesn't match the case of keyword.
Please look into it and share how to ensure the keyword is checked ignoring the case of the characters.

Getting the list of keys based on pattern or all.

Hi
If we have done IDistributedCache implementation, there is currently no method exposed which can give list of all the keys for a particular tenant.
We would like to request a feature where a method is exposed where we give a pattern (or not for all the keys) and get list of keys following that pattern.
A pattern could be as simple as key_containing_this_string or starting_word_is_this_string* or *ending_word_is_this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.