RickDotNet.FusionRocks 0.1.5

dotnet add package RickDotNet.FusionRocks --version 0.1.5
NuGet\Install-Package RickDotNet.FusionRocks -Version 0.1.5
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RickDotNet.FusionRocks" Version="0.1.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add RickDotNet.FusionRocks --version 0.1.5
#r "nuget: RickDotNet.FusionRocks, 0.1.5"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install RickDotNet.FusionRocks as a Cake Addin
#addin nuget:?package=RickDotNet.FusionRocks&version=0.1.5

// Install RickDotNet.FusionRocks as a Cake Tool
#tool nuget:?package=RickDotNet.FusionRocks&version=0.1.5

FusionRocks: RocksDB-Persisted Cache for FusionCache

FusionRocks is a persistent caching solution for .NET applications that integrates with the powerful FusionCache library. It leverages RocksDB, a high-performance embedded database for key-value data, to store cache data on disk, providing a robust and efficient caching mechanism. FusionRocks implements the IDistributedCache interface for compatibility and ease of use, making it an ideal choice for scenarios requiring data durability and high throughput.

Features

  • Persistence: Utilizes RocksDB for durable cache storage, ensuring that cached data is preserved across application restarts and crashes.
  • FusionCache Integration: Designed to work seamlessly with ZiggyCreatures' FusionCache, taking advantage of its sophisticated caching strategies and policies.
  • High Performance: RocksDB's optimized storage engine provides fast read and write operations, suitable for high-load environments.
  • Configurable: Offers customizable options to tailor the RocksDB instance, including database path, compression, and caching behaviors.
  • Asynchronous Support: Provides async methods that follow the async/await pattern in .NET for non-blocking cache operations.
  • Ease of Setup: Can be easily configured with a fluent API, making it simple to integrate into your .NET projects.

Installation

To start using FusionRocks in your application, install the package via your preferred NuGet package manager:

Install-Package RickDotNet.FusionRocks

Configuration

In your application's startup configuration, register FusionRocks with the service collection as follows:

// In your ConfigureServices method or wherever you register DI services
var fusion = builder.Services  
    .AddFusionCache()  
    .WithFusionRocks(builder.Services, options =>
    {
        options.CachePath = "fusionrocks";
    })
    .WithDefaultEntryOptions(new FusionCacheEntryOptions(TimeSpan.FromMinutes(2)));

Usage

After configuring FusionRocks, you can interact with FusionCache as usual:

var userId = 12345;

var user = cache.GetOrSet<User>(
    $"user:{userId}",
    _ => GetUserFromDatabase(userId),
    TimeSpan.FromSeconds(30)
);

Acknowledgments

This project uses the following open-source software:

License

FusionRocks is released under the MIT License, allowing you to freely use, modify, and distribute the software within the confines of the license.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.5 101 4/2/2024
0.1.1 116 3/30/2024