https://github.com/foundatiofx/foundatio
Pluggable foundation blocks for building distributed apps.
https://github.com/foundatiofx/foundatio
abstractions aws azure c-sharp distributed distributed-locks distributed-systems foundatio job-scheduler jobs lock logging message-bus messaging metrics queue redis s3 statsd storage
Last synced: 27 days ago
JSON representation
Pluggable foundation blocks for building distributed apps.
- Host: GitHub
- URL: https://github.com/foundatiofx/foundatio
- Owner: FoundatioFx
- License: apache-2.0
- Created: 2015-02-05T17:47:22.000Z (about 11 years ago)
- Default Branch: main
- Last Pushed: 2025-05-09T18:17:43.000Z (10 months ago)
- Last Synced: 2025-05-10T10:42:50.474Z (10 months ago)
- Topics: abstractions, aws, azure, c-sharp, distributed, distributed-locks, distributed-systems, foundatio, job-scheduler, jobs, lock, logging, message-bus, messaging, metrics, queue, redis, s3, statsd, storage
- Language: C#
- Homepage:
- Size: 5.44 MB
- Stars: 2,025
- Watchers: 99
- Forks: 247
- Open Issues: 29
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.txt
Awesome Lists containing this project
README

[](https://github.com/FoundatioFx/Foundatio/actions)
[](https://www.nuget.org/packages/Foundatio/)
[](https://f.feedz.io/foundatio/foundatio/packages/Foundatio/latest/download)
[](https://discord.gg/6HxgFCx)
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**](https://foundatio.dev/guide/caching) | In-memory, Redis, and hybrid caching with automatic invalidation |
| [**Queues**](https://foundatio.dev/guide/queues) | Reliable message queuing with Redis, Azure, AWS SQS |
| [**Locks**](https://foundatio.dev/guide/locks) | Distributed locking and throttling |
| [**Messaging**](https://foundatio.dev/guide/messaging) | Pub/sub with Redis, RabbitMQ, Kafka, Azure Service Bus |
| [**Jobs**](https://foundatio.dev/guide/jobs) | Background job processing with queue integration |
| [**File Storage**](https://foundatio.dev/guide/storage) | Unified file API for disk, S3, Azure Blob, and more |
| [**Resilience**](https://foundatio.dev/guide/resilience) | Retry policies, circuit breakers, and timeouts |
## ๐ Quick Start
```bash
dotnet add package Foundatio
```
```csharp
// Caching
ICacheClient cache = new InMemoryCacheClient();
await cache.SetAsync("user:123", user, TimeSpan.FromMinutes(5));
var cached = await cache.GetAsync("user:123");
// Queuing
IQueue queue = new InMemoryQueue();
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](https://foundatio.dev/guide/implementations/in-memory) | โ
| โ
| โ
| โ
| โ
|
| [Redis](https://github.com/FoundatioFx/Foundatio.Redis) | โ
| โ
| โ
| โ
| โ
|
| [Azure Storage](https://github.com/FoundatioFx/Foundatio.AzureStorage) | | โ
| | โ
| |
| [Azure Service Bus](https://github.com/FoundatioFx/Foundatio.AzureServiceBus) | | โ
| โ
| | |
| [AWS (S3/SQS/SNS)](https://github.com/FoundatioFx/Foundatio.AWS) | | โ
| โ
| โ
| |
| [RabbitMQ](https://github.com/FoundatioFx/Foundatio.RabbitMQ) | | | โ
| | |
| [Kafka](https://github.com/FoundatioFx/Foundatio.Kafka) | | | โ
| | |
| [Minio](https://github.com/FoundatioFx/Foundatio.Minio) | | | | โ
| |
| [Aliyun](https://github.com/FoundatioFx/Foundatio.Aliyun) | | | | โ
| |
| [SFTP](https://github.com/FoundatioFx/Foundatio.Storage.SshNet) | | | | โ
| |
## ๐ Learn More
**๐ [Complete Documentation](https://foundatio.dev)**
### Core Features
- [Getting Started](https://foundatio.dev/guide/getting-started) - Installation and setup
- [Caching](https://foundatio.dev/guide/caching) - In-memory, Redis, and hybrid caching with invalidation
- [Queues](https://foundatio.dev/guide/queues) - FIFO message delivery with lock renewal and retry policies
- [Locks](https://foundatio.dev/guide/locks) - Distributed locking with null handling patterns
- [Messaging](https://foundatio.dev/guide/messaging) - Pub/sub with size limits and notification patterns
- [File Storage](https://foundatio.dev/guide/storage) - Unified file API across providers
- [Jobs](https://foundatio.dev/guide/jobs) - Background job processing and hosted service integration
### Advanced Topics
- [Resilience](https://foundatio.dev/guide/resilience) - Retry policies, circuit breakers, and timeouts
- [Serialization](https://foundatio.dev/guide/serialization) - Serializer configuration and performance
- [Dependency Injection](https://foundatio.dev/guide/dependency-injection) - DI setup and patterns
- [Configuration](https://foundatio.dev/guide/configuration) - Options and settings
## ๐ฆ CI Packages (Feedz)
Want the latest CI build before it hits NuGet? Add the Feedz source and install the pre-release version:
```bash
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`:
```xml
```
## ๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request. See our [documentation](https://foundatio.dev) 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**](https://github.com/FoundatioFx/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
[](https://github.com/foundatiofx/foundatio/graphs/contributors)