A production-grade demonstration of Microsoft Orleans + SignalR + Blazor WASM for building scalable, real-time chat applications with immutable event sourcing.
- Educational Reference: Canonical example of Orleans + SignalR integration
- Production Patterns: Clean architecture, testability, observability
- Minimal Overhead: Responsive real-time UX on modest hardware
- Horizontal Scaling: Multi-silo Orleans cluster with zero message loss
- Immutable Events: All operations as auditable, replayable events
Blazor Client (WASM)
│
├─► REST API (Message History)
│
└─► SignalR (Live Events)
│
▼
Orleans Cluster (3 Silos)
│
├─► UserGrain (Presence & Connections)
├─► RoomGrain (Membership & Routing)
├─► MessageGrain (Message Lifecycle)
└─► StreamManagerGrain (Event Broadcasting)
│
▼
File/JSON Storage (Event Logs)
- .NET 8.0 SDK
- Visual Studio 2022 or VS Code
# Clone the repository
git clone https://github.com/Open-NET-Libraries/Open.Orleans.git
cd Open.Orleans
# Start Orleans cluster (3 silos)
dotnet run --project src/Open.Orleans.Silo
# Start SignalR server
dotnet run --project src/Open.Orleans.Server
# Launch Blazor client
dotnet run --project src/Open.Orleans.Client.Blazor
Navigate to https://localhost:7001
to access the chat interface.
├── src/
│ ├── libraries/ # Reusable Orleans libraries
│ │ ├── Open.Orleans.Core/ # Core abstractions & utilities
│ │ ├── Open.Orleans.Persistence.File/ # File-based persistence provider
│ │ └── Open.Orleans.SignalR/ # SignalR integration library
│ └── demos/
│ └── liveforum/ # Real-time chat demo
│ ├── Open.Orleans.LiveForum.Contracts/ # Shared interfaces & DTOs
│ ├── Open.Orleans.LiveForum.Grains/ # Orleans grain implementations
│ ├── Open.Orleans.LiveForum.Silo/ # Orleans hosting & configuration
│ ├── Open.Orleans.LiveForum.Server/ # SignalR hubs & REST API
│ └── Open.Orleans.LiveForum.Client/ # Blazor WASM client
├── test/
│ ├── Open.Orleans.Tests.Unit/ # Library unit tests
│ └── Open.Orleans.LiveForum.Tests.Integration/ # Demo integration tests
├── docs/
│ ├── spec.md # Architecture specification
│ ├── benchmarks/ # Performance test results
│ └── deployment/ # Production deployment guides
└── scripts/
├── start-cluster.ps1 # Multi-silo startup script
└── load-test.ps1 # Performance testing
- Sub-100ms message delivery (local cluster)
- Live typing indicators and presence
- Multi-device connection support
- Automatic reconnection handling
- Immutable event sourcing for all operations
- Message editing with full history
- Soft delete with audit trail preservation
- Infinite scroll with REST-based pagination
- Multi-silo horizontal scaling
- Structured logging with correlation IDs
- Metrics and observability endpoints
- Graceful failure recovery
- Comprehensive unit test coverage
- Integration tests for multi-silo scenarios
- Load testing with 1000+ concurrent users
- Automated CI/CD pipeline
Metric | Local (3 Silos) | Cloud (3 Nodes) |
---|---|---|
Message Latency (p95) | < 100ms | < 200ms |
Concurrent Users | 1,000+ | 5,000+ |
Memory per Silo | < 1GB | < 2GB |
CPU Utilization | < 30% | < 50% |
Benchmarks available in /docs/benchmarks/
{
"Orleans": {
"ClusterId": "open-orleans-dev",
"ServiceId": "chat-service",
"Persistence": {
"Provider": "File",
"Path": "./storage"
}
}
}
{
"SignalR": {
"MaxConnectionCount": 10000,
"KeepAliveInterval": "00:00:15",
"ClientTimeoutInterval": "00:01:00"
}
}
We welcome contributions! Please see our Contributing Guidelines.
- Fork the repository
- Create a feature branch
- Write tests for new functionality
- Ensure all tests pass
- Submit a pull request
- Architecture Specification - Detailed system design
- API Documentation - REST endpoints and SignalR events
- Deployment Guide - Production setup instructions
- Performance Tuning - Optimization recommendations
This project is licensed under the MIT License.
Built with:
- Microsoft Orleans - Virtual Actor Model
- ASP.NET Core SignalR - Real-time communication
- Blazor WebAssembly - Client framework
⭐ Star this repository if you find it helpful for learning Orleans and SignalR!
💬 Questions? Open an issue or start a discussion.
🚀 Want to contribute? Check out our good first issues.