Code Monkey home page Code Monkey logo

distributedmemorycache's Introduction

DistributedMemm: Distributed Memory Caching using RabbitMQ

Introduction

DistributedMemm is a C# library designed to provide distributed memory caching capabilities for .NET applications. By leveraging the power of RabbitMQ, this library ensures seamless data synchronization between multiple applications. In the event of cache data loss, DistributedMemm provides data recovery features using MongoDB.

Features

  • Distributed Caching: Extend the benefits of in-memory caching across multiple applications or instances.
  • Data Synchronization: Using RabbitMQ, DistributedMemm ensures that data changes are broadcast and synchronized across all connected applications.
  • Idempotency: Ensures that operations are processed once and only once, preventing duplicate data and actions.
  • Data Recovery: With the backup mechanism in MongoDB, applications can restore their memory cache on startup, ensuring minimal downtime and data loss.
  • Integrated API: An additional API that consumes RabbitMQ events to maintain and update MongoDB backup data.

Prerequisites

  • .NET Core or .NET 6+
  • RabbitMQ Server
  • MongoDB (if persist option enabled)

Installation

[Provide steps or code snippets to install and set up the library in a project]

Quick Start

  1. Configuration: Set up your RabbitMQ and MongoDB configurations.

    var config = new DistriCacheConfig
    {
        RabbitMQConnectionString = "YOUR_RABBITMQ_CONNECTION_STRING",
        MongoDBConnectionString = "YOUR_MONGODB_CONNECTION_STRING"
    };
  2. Initialize DistributedMemm:

    private readonly IDistributedMemm _distributedMemm;
    
    public TestService(IDistributedMemm distributedMemm)
    {
        _distributedMemm = distributedMemm;
    }
  3. Usage:

    _distributedMemm.Add("key", "value");
    _distributedMemm.Add("key", new { Name = "jhon", SurName = "doe" });
    var value = _distributedMemm.Get("key");

Data Recovery

In case application restarts our library will try to restore data by calling reserve api.

Contributing

We welcome contributions! Please see our CONTRIBUTING.md for details.

License

This project is licensed under [LICENSE NAME]. See the LICENSE file for details.

distributedmemorycache's People

Contributors

shak-o avatar kokooch avatar giorgi01 avatar zurabkavtaradze1 avatar

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.