OptunaSharp.Storage.StackExchange.Redis
1.0.0
dotnet add package OptunaSharp.Storage.StackExchange.Redis --version 1.0.0
NuGet\Install-Package OptunaSharp.Storage.StackExchange.Redis -Version 1.0.0
<PackageReference Include="OptunaSharp.Storage.StackExchange.Redis" Version="1.0.0" />
<PackageVersion Include="OptunaSharp.Storage.StackExchange.Redis" Version="1.0.0" />
<PackageReference Include="OptunaSharp.Storage.StackExchange.Redis" />
paket add OptunaSharp.Storage.StackExchange.Redis --version 1.0.0
#r "nuget: OptunaSharp.Storage.StackExchange.Redis, 1.0.0"
#:package OptunaSharp.Storage.StackExchange.Redis@1.0.0
#addin nuget:?package=OptunaSharp.Storage.StackExchange.Redis&version=1.0.0
#tool nuget:?package=OptunaSharp.Storage.StackExchange.Redis&version=1.0.0
OptunaSharp.Storage.StackExchange.Redis
Redis journal-log backend for OptunaSharp on StackExchange.Redis — the de-facto-standard .NET Redis client (MIT). Part of the SciSharp STACK.
StackExchangeJournalRedisBackend persists an Optuna study's operation log to a Redis server
(standalone or cluster). It is byte-compatible with Python Optuna's
optuna.storages.journal.JournalRedisBackend and with the sibling NRedisStack/ServiceStack
backends — a study written by any of them can be read by the others over the same Redis.
Usage
using OptunaSharp.Storages;
using OptunaSharp.Storages.Journal;
var backend = new StackExchangeJournalRedisBackend("redis://localhost:6379");
var study = Optuna.CreateStudy(storage: new JournalStorage(backend));
study.Optimize(t => { var x = t.SuggestFloat("x", -10, 10); return (x - 2) * (x - 2); }, nTrials: 20);
redis://, rediss:// (TLS) and unix:// URLs are accepted (optional [user]:[pass]@, /db,
?db=). For a cluster, pass useCluster: true.
Native StackExchange.Redis configuration
The URL constructor mirrors Python Optuna, but you are not limited to it — drive StackExchange.Redis
on its own terms. Four constructors, all taking the same useCluster / prefix:
// 1. redis-py-style URL (Optuna-identical)
new StackExchangeJournalRedisBackend("redis://localhost:6379");
// 2. keep the URL, tweak the derived ConfigurationOptions
new StackExchangeJournalRedisBackend("redis://localhost:6379", o =>
{
o.ConnectTimeout = 5000;
o.ClientName = "my-app";
o.ConnectRetry = 3;
});
// 3. a ConfigurationOptions you built yourself (timeouts, retry policy, TLS certs, CommandMap, …)
var options = new ConfigurationOptions { EndPoints = { "localhost:6379" }, Ssl = true, ClientName = "my-app" };
new StackExchangeJournalRedisBackend(options);
// 4. an IConnectionMultiplexer you already own (pooled / shared / DI-managed — you keep its lifetime)
new StackExchangeJournalRedisBackend(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. (StackExchange.Redis is MIT.)
| 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. 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. |
-
net10.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
- OptunaSharp (>= 1.0.0)
- OptunaSharp.Storage.Redis (>= 1.0.0)
- StackExchange.Redis (>= 3.1.31)
-
net8.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2)
- OptunaSharp (>= 1.0.0)
- OptunaSharp.Storage.Redis (>= 1.0.0)
- StackExchange.Redis (>= 2.13.17)
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 | 58 | 11/8/2026 |