Deterministic sharding primitives for .NET: consistent hash routing, modulo router, broadcasting, metrics hooks, migration scaffold.
$ dotnet add package ShardisDeterministic sharding primitives for .NET: routing, hashing, and core DI extension points used across the Shardis ecosystem.
dotnet add package Shardis --version 0.1.*
Shard, ShardId, ShardKey — core value types.IShardRouter<T> and DefaultShardRouter — routing abstractions and a default implementation.IShardFactory<T> — provider-agnostic factory for shard-scoped resources (DbContext, Marten sessions, Redis databases, etc.).IShardMap & InMemoryShardMap — declarative shard configuration / connection source.IShardKeyHasher<TKey>, IShardRingHasher.ServiceCollectionExtensions.AddShardis() — DI wiring helpers.// register core sharding primitives
services.AddShardis<string>(opts =>
{
opts.ReplicationFactor = 3;
});
// resolve router + map store
var router = provider.GetRequiredService<IShardRouter<string>>();
var mapStore = provider.GetRequiredService<IShardMapStore<string>>();
ServiceCollectionExtensions.AddShardis<TK>(options => {...}) — configure replication factor and defaults.Shardis.* packages (queries, persistence providers, migration).net8.0, net9.0.Please read contribution guidelines: https://github.com/veggerby/shardis/blob/main/CONTRIBUTING.md
MIT — see https://github.com/veggerby/shardis/blob/main/LICENSE