Foundatio is a free, open source monitoring & observability project written in C# and released under Apache-2.0. It has 2,104 GitHub stars, 251 forks and 15 open issues, and was last pushed 5 days ago. On this registry it ranks #171 of 270 tracked projects in Monitoring & Observability, with 5 head-to-head comparisons available. It gained 5 stars over the last 30 tracked days.

What is Foundatio?

Foundatio is an open-source C# library, published on NuGet under the Apache-2.0 licence, that provides pluggable foundation blocks — caching, queues, distributed locks, messaging, background jobs, file storage, and resilience — for building loosely coupled distributed applications.

What it is

Foundatio is an interface-first library for .NET. Applications code against abstractions such as ICacheClient, IQueue, IFileStorage, and ILockProvider instead of against a specific vendor SDK, and the same patterns repeat across caching, queues, storage, messaging, and locks. It ships in-memory implementations including InMemoryCacheClient, InMemoryQueue, and InMemoryFileStorage, plus a CacheLockProvider for distributed locking, and it is built for Microsoft.Extensions.DependencyInjection. Provider implementations live in separate packages, among them Foundatio.Redis, Foundatio.AzureStorage, Foundatio.AzureServiceBus, Foundatio.AWS, Foundatio.RabbitMQ, Foundatio.Kafka, Foundatio.Minio, Foundatio.Aliyun, and Foundatio.Storage.SshNet.

The concrete problem it solves is provider lock-in and duplicated plumbing. A team that needs a cache, a queue, pub/sub, file storage, and a distributed lock would normally write separate integration code for Redis, Azure, AWS, RabbitMQ, or Kafka, then rewrite it when the backing service changes. Foundatio replaces that work with one set of abstractions and consistent APIs, so a Redis, Azure, AWS, or in-memory backend can be swapped with no code changes. Retry policies, circuit breakers, and timeouts are folded into the same model through the resilience block.

Key capabilities

  • Caching with in-memory, Redis, and hybrid modes, including automatic invalidation.
  • Reliable message queuing backed by Redis, Azure, and AWS SQS.
  • Distributed locking and throttling through the ILockProvider abstraction and CacheLockProvider.
  • Pub/sub messaging over Redis, RabbitMQ, Kafka, and Azure Service Bus.
  • Background job processing with queue integration, with a job-scheduler topic in the project index.
  • A unified file storage API covering disk, S3, Azure Blob, Minio, Aliyun, and SFTP.
  • Resilience primitives: retry policies, circuit breakers, and timeouts.

Who uses it and how

  • .NET teams building distributed systems that want to code against abstractions rather than a single cloud vendor's SDK.
  • Teams running local development and automated tests against the in-memory cache, queue, messaging, storage, and lock implementations, then switching to a real provider at deployment time without changing application code.
  • Multi-cloud and hybrid deployments that mix AWS (S3, SQS, SNS), Azure (Storage, Service Bus), Redis, RabbitMQ, Kafka, Minio, Aliyun, and SFTP in the same application.
  • Applications already wired through Microsoft.Extensions.DependencyInjection that need caching, queuing, and background jobs registered through the same container.

Getting started

Install the core package with dotnet add package Foundatio. Provider packages such as Foundatio.Redis, Foundatio.AzureStorage, or Foundatio.AWS are added alongside it, and the guide at foundatio.dev covers installation and setup, caching, queues, and the rest of the building blocks.

How it compares

The facts list no paid products that Foundatio replaces, and no directly comparable library is named alongside it. On the evidence here, it stands alone in this registry.

When to use it — and when not to

Foundatio is a library, not a hosted service, so a self-hoster still has to run and operate whichever backing systems are chosen — Redis, RabbitMQ, Kafka, Azure Service Bus, Azure Storage, S3, Minio, Aliyun, or an SFTP server — and the in-memory implementations are intended for local development and testing rather than as a shared production backend. It is not a fit for teams outside the .NET stack, since the abstractions and packages are C#. The licence is a clear Apache-2.0, the repository is active with a recent push and 15 open issues, so the main cost to weigh is operational: someone must own the provider infrastructure underneath.

project readme (upstream, from github) — read inline

FoundatioFoundatio

Build status NuGet Version feedz.io Discord

Pluggable foundation blocks for building loosely coupled distributed apps.

✨ Why Choose Foundatio?

  • 🔌 Pluggable implementations - Swap Redis, Azure, AWS, or in-memory with no code changes
  • 🧪 Developer friendly - In-memory implementations for fast local development and testing
  • 💉 DI native - Built for Microsoft.Extensions.DependencyInjection
  • 🎯 Interface-first - Code against abstractions, not implementations
  • ⚡ Production ready - Battle-tested in high-scale applications
  • 🔄 Consistent APIs - Same patterns across caching, queues, storage, and more

🧱 Core Building Blocks

Feature Description
Caching In-memory, Redis, and hybrid caching with automatic invalidation
Queues Reliable message queuing with Redis, Azure, AWS SQS
Locks Distributed locking and throttling
Messaging Pub/sub with Redis, RabbitMQ, Kafka, Azure Service Bus
Jobs Background job processing with queue integration
File Storage Unified file API for disk, S3, Azure Blob, and more
Resilience Retry policies, circuit breakers, and timeouts

🚀 Quick Start

dotnet add package Foundatio
// Caching
ICacheClient cache = new InMemoryCacheClient();
await cache.SetAsync("user:123", user, TimeSpan.FromMinutes(5));
var cached = await cache.GetAsync<User>("user:123");

// Queuing
IQueue<WorkItem> queue = new InMemoryQueue<WorkItem>();
await queue.EnqueueAsync(new WorkItem { Data = "Hello" });
var entry = await queue.DequeueAsync();

// File Storage
IFileStorage storage = new InMemoryFileStorage();
await storage.SaveFileAsync("docs/readme.txt", "Hello World");

// Distributed Locks
ILockProvider locker = new CacheLockProvider(cache, messageBus);
await using var handle = await locker.AcquireAsync("resource-key");

📦 Provider Implementations

Provider Caching Queues Messaging Storage Locks
In-Memory ✅ ✅ ✅ ✅ ✅
Redis ✅ ✅ ✅ ✅ ✅
Azure Storage ✅ ✅
Azure Service Bus ✅ ✅
AWS (S3/SQS/SNS) ✅ ✅ ✅
RabbitMQ ✅
Kafka ✅
Minio ✅
Aliyun ✅
SFTP ✅

📚 Learn More

👉 Complete Documentation

Core Features

  • Getting Started - Installation and setup
  • Caching - In-memory, Redis, and hybrid caching with invalidation
  • Queues - FIFO message delivery with lock renewal and retry policies
  • Locks - Distributed locking with null handling patterns
  • Messaging - Pub/sub with size limits and notification patterns
  • File Storage - Unified file API across providers
  • Jobs - Background job processing and hosted service integration

Advanced Topics

📦 CI Packages (Feedz)

Want the latest CI build before it hits NuGet? Add the Feedz source and install the pre-release version:

dotnet nuget add source https://f.feedz.io/foundatio/foundatio/nuget -n foundatio-feedz
dotnet add package Foundatio --prerelease

Or add to your NuGet.config:

<configuration>
  <packageSources>
    <add key="foundatio-feedz" value="https://f.feedz.io/foundatio/foundatio/nuget" />
  </packageSources>
  <packageSourceMapping>
    <packageSource key="foundatio-feedz">
      <package pattern="Foundatio.*" />
    </packageSource>
  </packageSourceMapping>
</configuration>

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. See our documentation for development guidelines.

Development Setup:

  1. Clone the repository
  2. Open Foundatio.slnx in Visual Studio or VS Code
  3. Run dotnet build to build
  4. Run dotnet test to run tests

🔗 Related Projects

  • Foundatio.Mediator - Blazingly fast, convention-based C# mediator powered by source generators

📄 License

Apache 2.0 License

Thanks to all the people who have contributed

contributors

Frequently asked questions

Is Foundatio free to use?

Foundatio is open source under the Apache-2.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does Foundatio do?

Pluggable foundation blocks for building distributed apps.

What is Foundatio written in?

Foundatio is primarily written in C#. Its source is publicly available at https://github.com/FoundatioFx/Foundatio, and it has 2,104 GitHub stars.