RickDotNet.FusionRocks
0.1.1
See the version list below for details.
dotnet add package RickDotNet.FusionRocks --version 0.1.1
NuGet\Install-Package RickDotNet.FusionRocks -Version 0.1.1
<PackageReference Include="RickDotNet.FusionRocks" Version="0.1.1" />
paket add RickDotNet.FusionRocks --version 0.1.1
#r "nuget: RickDotNet.FusionRocks, 0.1.1"
// Install RickDotNet.FusionRocks as a Cake Addin
#addin nuget:?package=RickDotNet.FusionRocks&version=0.1.1
// Install RickDotNet.FusionRocks as a Cake Tool
#tool nuget:?package=RickDotNet.FusionRocks&version=0.1.1
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:
- RocksDb - licensed under the BSD-2-Clause License.
- FusionCache - licensed under the MIT License.
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 | Versions 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. |
-
net8.0
- Microsoft.Extensions.Caching.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Options (>= 8.0.2)
- RocksDB (>= 8.11.3.46984)
- ZiggyCreatures.FusionCache (>= 1.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.