OptunaSharp.Storage.NRedisStack 1.0.0

dotnet add package OptunaSharp.Storage.NRedisStack --version 1.0.0
                    
NuGet\Install-Package OptunaSharp.Storage.NRedisStack -Version 1.0.0
                    
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="OptunaSharp.Storage.NRedisStack" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OptunaSharp.Storage.NRedisStack" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="OptunaSharp.Storage.NRedisStack" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add OptunaSharp.Storage.NRedisStack --version 1.0.0
                    
#r "nuget: OptunaSharp.Storage.NRedisStack, 1.0.0"
                    
#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.
#:package OptunaSharp.Storage.NRedisStack@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=OptunaSharp.Storage.NRedisStack&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=OptunaSharp.Storage.NRedisStack&version=1.0.0
                    
Install as a Cake Tool

OptunaSharp.Storage.NRedisStack

Redis journal-log backend for OptunaSharp on NRedisStack — Redis's official .NET client (MIT). Part of the SciSharp STACK.

NRedisStackJournalRedisBackend persists an Optuna study's operation log to a Redis server. It is byte-compatible with Python Optuna's JournalRedisBackend and with the sibling StackExchange/ServiceStack backends — a study written by any of them can be read by the others over the same Redis.

Note on NRedisStack

NRedisStack layers the Redis Stack module commands (JSON, Search, TimeSeries, Bloom) on top of StackExchange.Redis. A journal backend needs only plain GET/SET/INCR/EVAL, so this backend uses the underlying StackExchange.Redis IDatabase surface (NRedisStack's modules do not apply, and storing the log as a RedisJSON document would change the stored bytes and break cross-language interop). Choose this package when your app already standardizes on NRedisStack.

Usage

using OptunaSharp.Storages;
using OptunaSharp.Storages.Journal;

var backend = new NRedisStackJournalRedisBackend("redis://localhost:6379");
var study = Optuna.CreateStudy(storage: new JournalStorage(backend));

Native configuration

The URL constructor mirrors Python Optuna, but you are not limited to it. Four constructors, all taking the same useCluster / prefix:

// 1. redis-py-style URL (Optuna-identical)
new NRedisStackJournalRedisBackend("redis://localhost:6379");

// 2. keep the URL, tweak the derived ConfigurationOptions
new NRedisStackJournalRedisBackend("redis://localhost:6379", o => { o.ConnectTimeout = 5000; o.ClientName = "my-app"; });

// 3. a ConfigurationOptions you built yourself
new NRedisStackJournalRedisBackend(new ConfigurationOptions { EndPoints = { "localhost:6379" }, Ssl = true });

// 4. an IConnectionMultiplexer you already own — e.g. the same connection you use for NRedisStack's
//    module APIs (JSON/Search/…) elsewhere in your app; you keep its lifetime
new NRedisStackJournalRedisBackend(existingMultiplexer);

The on-wire journal format is fixed regardless of how you connect, so the study stays byte-compatible with Python Optuna and the sibling backends whichever constructor you use.

License

MIT © SciSharp STACK Team. (NRedisStack is MIT.)

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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.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
1.0.0 75 11/8/2026