FGutierrez.Core.Idempotency
1.1.7
See the version list below for details.
dotnet add package FGutierrez.Core.Idempotency --version 1.1.7
NuGet\Install-Package FGutierrez.Core.Idempotency -Version 1.1.7
<PackageReference Include="FGutierrez.Core.Idempotency" Version="1.1.7" />
<PackageVersion Include="FGutierrez.Core.Idempotency" Version="1.1.7" />
<PackageReference Include="FGutierrez.Core.Idempotency" />
paket add FGutierrez.Core.Idempotency --version 1.1.7
#r "nuget: FGutierrez.Core.Idempotency, 1.1.7"
#:package FGutierrez.Core.Idempotency@1.1.7
#addin nuget:?package=FGutierrez.Core.Idempotency&version=1.1.7
#tool nuget:?package=FGutierrez.Core.Idempotency&version=1.1.7
โก FGutierrez.Core.Idempotency
๐ Overview
FGutierrez.Core.Idempotency is a high-performance .NET 8 library designed to guarantee that critical operations such as payments, order creation, and transactional workflows are executed exactly once, even in scenarios involving retries, duplicated requests, or network failures.
The library provides a distributed idempotency engine with multi-provider persistence support and built-in observability integrations.
๐ฏ Why This Library?
Implementing idempotency manually often introduces:
- Boilerplate middleware
- Duplicate business execution
- Inconsistent storage logic
- Poor traceability
- Lack of metrics and diagnostics
This library solves those challenges through a unified and extensible architecture.
โจ Features
| Feature | Description |
|---|---|
| โก High Performance | Optimized request interception pipeline |
| ๐ Multi-Provider | Redis or PostgreSQL support |
| ๐ Observability | OpenTelemetry metrics & tracing |
| โป Response Caching | Stores and replays original responses |
| ๐ Duplicate Prevention | Prevents re-execution of business operations |
| ๐งฉ Extensible | Provider-based architecture |
| ๐ Auto Schema | Automatic PostgreSQL schema generation |
๐ง Architecture
๐๏ธ Architecture & Workflow

๐ฆ Supported Providers
| Provider | Technology |
|---|---|
| PostgreSQL | Dapper |
| Redis | StackExchange.Redis |
๐ Observability
The library exposes native OpenTelemetry instrumentation for:
- Request duration
- Cache hits/misses
- Duplicate detection
- Storage latency
- Exception tracking
Compatible with:
- Jaeger
- Prometheus
- Grafana
- OTLP Collectors
๐ฆ Installation
dotnet add package FGutierrez.Core.Idempotency
โ๏ธ Configuration
appsettings.json
{
"ConnectionStrings": {
"Idempotency": "Host=localhost;Port=5432;Database=observability_db;Username=admin;Password=admin"
},
"Idempotency": {
"Enabled": true,
"Provider": "PostgreSQL",
"AllowedMethods": [ "POST", "PUT", "DELETE" ],
"HeaderName": "X-Idempotency-Key",
"Expiration": "24:00:00",
"MeterName": "FGutierrez.Core.Idempotency"
}
}
๐ Quick Start
Register Services
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddIdempotencyProvider(builder.Configuration);
var app = builder.Build();
Enable Middleware
app.UseIdempotency();
app.Run();
โ๏ธ Request Lifecycle
- Client sends a request with
X-Idempotency-Key - Middleware checks storage provider
- If the key exists:
- Cached response is returned
- If the key does not exist:
- Business logic executes normally
- Response is persisted
- Response is returned to the client
- Telemetry is exported automatically
๐ Requirements
- .NET 8 SDK
- PostgreSQL 16+ or Redis 7+
- Optional OpenTelemetry Collector
๐งช Future Roadmap
- SQL Server Provider
- MongoDB Provider
๐ค Contributing
Contributions are welcome.
To contribute:
- Fork the repository
- Create a feature branch
- Commit your changes
- Open a Pull Request
๐ License
MIT License ยฉ Federin Pastor Gutierrez Ortiz
โญ Support
If this project helped you, consider giving it a star on GitHub.
| 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 was computed. 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. |
-
net8.0
- Dapper (>= 2.1.79)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.3.10)
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 8.0.2)
- Microsoft.Extensions.Options (>= 8.0.2)
- Npgsql (>= 8.0.3)
- OpenTelemetry.Api (>= 1.15.3)
- StackExchange.Redis (>= 2.13.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
# Release Notes - 1.1.3
- Refactor: Migrated agnostic registration to Core.
- Fix: Downgraded Npgsql to 8.0.3 to resolve TypeLoadException.
- Feature: Added AddIdempotencyProvider(IConfiguration) extension.
- Clean: Removed deprecated Http.Abstractions dependencies.
## [1.1.6] - 2026-05-26
### Fixed
- Correct Error: Fixed comparison error in AddIdempotencyProvider where ToUpperInvariant() did not match switch cases.