EricksonLopez.Idempotency
dotnet-idempotency · Reliability & Concurrency
On this page (20 sections)
1. Identity, Tier & Maturity Profile#
2. Value Proposition & Problem Solved#
High-performance, Native AOT-first architectural idempotency engine, lease fencing, deterministic SHA-256 fingerprinting, and distributed consistency for modern .NET.
Network retries, client timeouts, and message redeliveries trigger duplicate side effects when endpoints or handlers lack atomic lease fencing and payload fingerprinting.
3. Quick Install#
Primary package: EricksonLopez.Idempotency
dotnet add package EricksonLopez.Idempotency --version 2.0.0<PackageReference Include="EricksonLopez.Idempotency" Version="2.0.0" /><PackageVersion Include="EricksonLopez.Idempotency" Version="2.0.0" />4. Verified Ecosystem Metrics#
Snapshot retrieved UTC: 2026-12-01
5. When to Use & When Not to Use#
When to use
- You need HTTP or Mediator command idempotency with SHA-256 request fingerprinting, lease ownership, and stored response replay.
When NOT to use
- Your operation is naturally idempotent (e.g., pure GET reads or deterministic PUT upserts with natural keys).
6. Core Capabilities & Design Invariants#
SHA-256 Fingerprinting & Value Objects
Stack-bounded IdempotencyKey and IdempotencyScope structs plus payload-tampering detection.
7 Storage Dialects & Replay
Atomic lease stores for PostgreSQL, SQL Server, MySQL, MariaDB, Oracle, SQLite, and Redis Lua with ASP.NET Core middleware.
7. Included NuGet Packages & Adapters#
| Package ID | Status | NuGet / Local | TFMs | AOT Status | Downloads | Description |
|---|---|---|---|---|---|---|
| EricksonLopez.IdempotencyPrimary | Published | v2.0.0 / v3.1.0 | net8.0, net9.0, net10.0 | AOT: Full | 622 | Core domain logic, fingerprint hashing, serialization, and orchestration engine for EricksonLopez.Idempotency. |
| EricksonLopez.Idempotency.Abstractions | Published | v2.0.0 / v3.1.0 | net8.0, net9.0, net10.0 | AOT: Full | 2,548 | Core abstractions, contracts, and domain primitives for the EricksonLopez.Idempotency library. |
| EricksonLopez.Idempotency.MySql | Published | v2.0.0 / v3.1.0 | net8.0, net9.0, net10.0 | AOT: Full | 317 | MySQL storage provider for EricksonLopez.Idempotency using Dapper, MySqlConnector, and raw SQL. |
| EricksonLopez.Idempotency.Testing | Published | v2.0.0 / v3.1.0 | net8.0, net9.0, net10.0 | AOT: Full | 285 | Testing utilities, in-memory test stores, and mock helpers for EricksonLopez.Idempotency. |
| EricksonLopez.Idempotency.MariaDb | Published | v2.0.0 / v3.1.0 | net8.0, net9.0, net10.0 | AOT: Full | 281 | MariaDB storage provider for EricksonLopez.Idempotency using Dapper, MySqlConnector, and raw SQL. |
| EricksonLopez.Idempotency.PostgreSql | Published | v2.0.0 / v3.1.0 | net8.0, net9.0, net10.0 | AOT: Full | 277 | PostgreSQL storage provider for EricksonLopez.Idempotency using Dapper and raw SQL. |
| EricksonLopez.Idempotency.Mediator | Published | v2.0.0 / v3.1.0 | net8.0, net9.0, net10.0 | AOT: Full | 275 | Mediator pipeline behavior integration for EricksonLopez.Idempotency. |
| EricksonLopez.Idempotency.Redis | Published | v2.0.0 / v3.1.0 | net8.0, net9.0, net10.0 | AOT: Full | 273 | Redis storage provider for EricksonLopez.Idempotency using StackExchange.Redis with Lua scripts for atomic operations. Note: Redis guarantees are slightly weaker than SQL providers (no fencing tokens); see docs/adr/adr-013-no-idistributedcache-abstraction.md for details. |
| EricksonLopez.Idempotency.Oracle | Published | v2.0.0 / v3.1.0 | net8.0, net9.0, net10.0 | AOT: Full | 270 | Oracle Database storage provider for EricksonLopez.Idempotency using Dapper, Oracle.ManagedDataAccess.Core, and raw SQL. |
| EricksonLopez.Idempotency.AspNetCore | Published | v2.0.0 / v3.1.0 | net8.0, net9.0, net10.0 | AOT: Full | 267 | ASP.NET Core integration, endpoint filters, and middleware for EricksonLopez.Idempotency. |
| EricksonLopez.Idempotency.Result | Published | v2.0.0 / v3.1.0 | net8.0, net9.0, net10.0 | AOT: Full | 266 | Result Pattern integration for EricksonLopez.Idempotency providing functional error factories and mapping. |
| EricksonLopez.Idempotency.Sqlite | Published | v2.0.0 / v3.1.0 | net8.0, net9.0, net10.0 | AOT: Full | 258 | SQLite storage provider for EricksonLopez.Idempotency using Dapper, Microsoft.Data.Sqlite, and raw SQL. |
| EricksonLopez.Idempotency.SqlServer | Published | v2.0.0 / v3.1.0 | net8.0, net9.0, net10.0 | AOT: Full | 254 | Microsoft SQL Server storage provider for EricksonLopez.Idempotency using Dapper and raw SQL. |
8. Quick Start Code Example#
Grounded in verified public APIs from EricksonLopez.Idempotency. Compile with `<ImplicitUsings>disable</ImplicitUsings>` and explicit imports.
using System;
using EricksonLopez.Idempotency;
using EricksonLopez.Idempotency.AspNetCore;
using EricksonLopez.Idempotency.PostgreSql;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Npgsql;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddSingleton(_ =>
NpgsqlDataSource.Create(builder.Configuration.GetConnectionString("Postgres")!));
builder.Services.AddPostgreSqlIdempotencyStore();
builder.Services.AddAspNetCoreIdempotency(options =>
{
options.HeaderName = "Idempotency-Key";
options.RequireIdempotencyKey = true;
options.DefaultLeaseDuration = TimeSpan.FromSeconds(30);
options.DefaultRetentionDuration = TimeSpan.FromDays(7);
});9. Architecture & Dependency Flow#
Rendering diagram…
flowchart LR lib_idempotency["EricksonLopez.Idempotency (L2)"] lib_result["EricksonLopez.Result (L0)"] lib_idempotency -.-> lib_result lib_mediator["EricksonLopez.Mediator (L2)"] lib_idempotency -.-> lib_mediator lib_messaging["EricksonLopez.Messaging (L3)"] lib_messaging -.-> lib_idempotency lib_outbox["EricksonLopez.Outbox (L3)"] lib_outbox --> lib_idempotency
View accessible text summary and structure
2 upstream library dependencies and 2 downstream dependent libraries verified in dependencies.json.
| Direction | Library | Tier | Relationship Kinds |
|---|---|---|---|
| Upstream | EricksonLopez.Result | L0 | Adapter, NuGet Package |
| Upstream | EricksonLopez.Mediator | L2 | Adapter, NuGet Package |
| Downstream | EricksonLopez.Messaging | L3 | Adapter |
| Downstream | EricksonLopez.Outbox | L3 | Compile-Time, NuGet Package |
flowchart LR
lib_idempotency["EricksonLopez.Idempotency (L2)"]
lib_result["EricksonLopez.Result (L0)"]
lib_idempotency -.-> lib_result
lib_mediator["EricksonLopez.Mediator (L2)"]
lib_idempotency -.-> lib_mediator
lib_messaging["EricksonLopez.Messaging (L3)"]
lib_messaging -.-> lib_idempotency
lib_outbox["EricksonLopez.Outbox (L3)"]
lib_outbox --> lib_idempotency10. Target Frameworks & Native AOT / Trimming Matrix#
MSBuild `.csproj` inspection across 13 packages: 13 Full, 0 Partial, 0 Incompatible, 0 NotApplicable (analyzers/generators).
| Package ID | IsAotCompatible | EnableTrimAnalyzer | Verified AOT Status | Target Frameworks |
|---|---|---|---|---|
| EricksonLopez.Idempotency | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Idempotency.Abstractions | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Idempotency.MySql | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Idempotency.Testing | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Idempotency.MariaDb | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Idempotency.PostgreSql | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Idempotency.Mediator | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Idempotency.Redis | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Idempotency.Oracle | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Idempotency.AspNetCore | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Idempotency.Result | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Idempotency.Sqlite | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Idempotency.SqlServer | true | true | Full | net8.0, net9.0, net10.0 |
11. Upstream Dependencies & Downstream Dependents#
Upstream Dependencies (2)
Downstream Dependents (2)
12. Optional Adapters & Third-Party Integrations#
Internal Adapter Edges & Integration Packages
- EricksonLopez.Idempotency.Mediator→ EricksonLopez.Mediator (EricksonLopez.Mediator)
- EricksonLopez.Idempotency.Result→ EricksonLopez.Result (EricksonLopez.Result)
- EricksonLopez.Messaging.Idempotency (EricksonLopez.Messaging)→ EricksonLopez.Idempotency.Abstractions
Verified External NuGet Dependencies (12)
13. Configuration & DI Registration Summary#
Verified DI & Configuration Entry Points
ServiceCollectionExtensions.AddIdempotencyCleanupServiceRegisters a hosted background service that periodically purges expired idempotency records from the store.
ServiceCollectionExtensions.AddIdempotencyCoreRegisters core idempotency abstractions, context accessors, serializers, and execution engines in the specified service collection.
AspNetCoreServiceCollectionExtensions.AddAspNetCoreIdempotencyRegisters ASP.NET Core endpoint filters, middleware dependencies, and core idempotency services in the specified service collection.
AspNetCoreServiceCollectionExtensions.UseIdempotencyEnables the idempotency middleware in the ASP.NET Core HTTP request pipeline.
IdempotencyOptionsAspNetCoreExtensions.UseTenantIdExtractorConfigures a typed `HttpContext` extractor delegate for resolving tenant identifiers.
MariaDbServiceCollectionExtensions.AddMariaDbIdempotencyStoreRegisters the MariaDB implementation of `IIdempotencyStore` and `ITransactionalIdempotencyStore` in the specified service collection.
MediatorServiceCollectionExtensions.AddMediatorIdempotencyRegisters the open generic `IdempotencyPipelineBehavior<TRequest, TResponse>` and core idempotency dependencies in the specified service collection.
MySqlServiceCollectionExtensions.AddMySqlIdempotencyStoreRegisters the MySQL implementation of `IIdempotencyStore` and `ITransactionalIdempotencyStore` in the specified service collection.
OracleServiceCollectionExtensions.AddOracleIdempotencyStoreRegisters the Oracle Database implementation of `IIdempotencyStore` in the specified service collection.
PostgreSqlServiceCollectionExtensions.AddPostgreSqlIdempotencyStoreRegisters the PostgreSQL implementation of `IIdempotencyStore` in the specified service collection.
RedisServiceCollectionExtensions.AddRedisIdempotencyRegisters `RedisIdempotencyStore` as the `IIdempotencyStore` implementation, using an existing `IConnectionMultiplexer` registered in the DI container.
SqlServerServiceCollectionExtensions.AddSqlServerIdempotencyStoreRegisters the SQL Server implementation of `IIdempotencyStore` in the specified service collection.
Key Public Types & Contracts
EricksonLopez.Idempotency.AsyncLocalIdempotencyContextAccessor (class)Provides access to the ambient `IdempotencyContext` flowed across asynchronous execution contexts.
EricksonLopez.Idempotency.CachedIdempotencyResponse (record)Represents the cached HTTP or application response associated with a completed idempotent operation.
EricksonLopez.Idempotency.ClaimResultStatus (enum)Defines the specific outcome of an attempt to acquire ownership or claim an idempotency key.
EricksonLopez.Idempotency.DefaultIdempotencyPolicy (class)Provides a default evaluation policy for idempotent operation execution based on configured options.
EricksonLopez.Idempotency.ExecutionResponse (record)Represents the protocol-agnostic response produced by an executed operation, containing the status code, response headers, and raw body payload.
EricksonLopez.Idempotency.FallbackCacheEntry (record)Represents a cached response entry stored within the in-memory fallback cache.
EricksonLopez.Idempotency.IFallbackCache (interface)Defines the abstraction for an in-memory fallback cache to provide high-resilience idempotency replay when the primary persistent storage provider is unavailable.
EricksonLopez.Idempotency.IIdempotencyContextAccessor (interface)Provides access to the current `IdempotencyContext`.
EricksonLopez.Idempotency.IIdempotencyFingerprintGenerator (interface)Defines a strategy for computing deterministic fingerprints from request components.
EricksonLopez.Idempotency.IIdempotencyKeyProvider`1 (interface)Defines a strategy for resolving an idempotency key from an incoming request or message context.
EricksonLopez.Idempotency.IIdempotencyPolicy (interface)Defines policy rules and evaluation criteria for idempotent operation execution.
EricksonLopez.Idempotency.IIdempotencySerializer (interface)Defines a contract for serializing and deserializing response and request payloads for idempotency storage.
14. Verified Performance Benchmarks#
All verified measurements below come strictly from `BenchmarkDotNet.Artifacts` running on .NET RyuJIT (0 NativeAOT benchmark runs exist in this snapshot).
No non-MEGA-AUDIT `BenchmarkDotNet.Artifacts` files were verified for this library in the snapshot (`hasBenchmarks: false`).
15. Release History & NuGet vs Repo Status#
Version lag detected: NuGet.org latest published version is v2.0.0, while local repository HEAD is at v3.1.0.
| Version | Source | Published Date | Summary |
|---|---|---|---|
| v2.0.0 ↗ | nuget | 2026-09-25 | Published EricksonLopez.Idempotency 2.0.0 to NuGet.org. |
| v2.0.0 ↗ | github | 2026-09-25 | [2.0.0](https://github.com/ericksonlopezf/dotnet-idempotency/compare/v1.0.0...v2.0.0) (2026-09-25) ⚠ BREAKING CHANGES * add relational outbox, uniform metadata and response headers blocklist ✨ Features * add relational outbox, uniform metadata and response headers blocklist ([1d8df51](https://github.com/ericksonlopezf/dotnet-idempotency/commit/1d8df510ea6d1a4215e7ee6c826688ec24ea9374)) |
| v1.0.0 ↗ | github | 2026-08-29 | Ecosystem Packages in this release | Package | Version | |---------|---------| | `EricksonLopez.Idempotency.Abstractions` | `1.0.0` | | `EricksonLopez.Idempotency` | `1.0.0` | | `EricksonLopez.Idempotency.AspNetCore` | `1.0.0` | | `EricksonLopez.Idempotency.MariaDb` | `1.0.0` | | `EricksonLopez.Idempotency.Mediator` | `1.0.0` | | `EricksonLopez.Idempotency.MySql` | `1.0.0` | | `EricksonLopez.Id... |
| v1.0.0 ↗ | nuget | 2026-08-29 | Published EricksonLopez.Idempotency 1.0.0 to NuGet.org. |
16. Complementary & Related Libraries#
Libraries in the same tier, architectural layer, or directly paired via dependency edges.
17. Documentation, API Reference & Portal Links#
Conceptual Documentation (Starlight) →
Extracted XML API Reference →
13 namespaces · 81 types · 364 members
Ecosystem Dependency Map →
Learning Center & Handbook →
Per-library conceptual Starlight pages expand in M4; API Reference pages expand in M3.2.
18. Source Repository, License & Contributing#
Released under the MIT License. All assemblies follow EricksonLopez.* build invariants: explicit imports, strong-name signing (`EricksonLopez.snk`), and ASCII author metadata (`Erickson Lopez`).
19. Troubleshooting, Pitfalls & Migration Guidance#
- Configure DefaultLeaseDuration longer than your downstream handler timeout so active requests are not reclaimed prematurely.
- Version lag detected: NuGet.org latest published version is v2.0.0, while local repository HEAD is at v3.1.0.
20. Quality & Verification Evidence#
- Strong-Name Signing (`EricksonLopez.snk`)
- EricksonLopez.snk
- `ImplicitUsings=disable`
- disable
- XML Documentation Extraction
- Verified (13 namespaces, 81 types, 364 members)
- MSBuild AOT / Trim Attributes
- 13 Full / 0 Partial / 0 Incompatible / 0 N/A
- BenchmarkDotNet Artifacts
- 0 total (0 measured, 0 na_error)
Explicit Verification Boundaries & Limitations
- All verified measurements below come strictly from `BenchmarkDotNet.Artifacts` running on .NET RyuJIT (0 NativeAOT benchmark runs exist in this snapshot).