Skip to content

Open-NET-Libraries/Open.Orleans

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Open.Orleans - Distributed Real-Time Chat System

A production-grade demonstration of Microsoft Orleans + SignalR + Blazor WASM for building scalable, real-time chat applications with immutable event sourcing.

🎯 Project Goals

  • 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

πŸ—οΈ Architecture

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)

πŸš€ Quick Start

Prerequisites

  • .NET 8.0 SDK
  • Visual Studio 2022 or VS Code

Running Locally

# 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.

πŸ“ Project Structure

β”œβ”€β”€ 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

🎭 Key Features

✨ Real-Time Messaging

  • Sub-100ms message delivery (local cluster)
  • Live typing indicators and presence
  • Multi-device connection support
  • Automatic reconnection handling

πŸ“š Message Management

  • Immutable event sourcing for all operations
  • Message editing with full history
  • Soft delete with audit trail preservation
  • Infinite scroll with REST-based pagination

🏒 Enterprise Ready

  • Multi-silo horizontal scaling
  • Structured logging with correlation IDs
  • Metrics and observability endpoints
  • Graceful failure recovery

πŸ§ͺ Testing & Quality

  • Comprehensive unit test coverage
  • Integration tests for multi-silo scenarios
  • Load testing with 1000+ concurrent users
  • Automated CI/CD pipeline

πŸ“Š Performance Benchmarks

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/

πŸ”§ Configuration

Orleans Clustering

{
  "Orleans": {
    "ClusterId": "open-orleans-dev",
    "ServiceId": "chat-service",
    "Persistence": {
      "Provider": "File",
      "Path": "./storage"
    }
  }
}

SignalR Options

{
  "SignalR": {
    "MaxConnectionCount": 10000,
    "KeepAliveInterval": "00:00:15",
    "ClientTimeoutInterval": "00:01:00"
  }
}

🀝 Contributing

We welcome contributions! Please see our Contributing Guidelines.

Development Workflow

  1. Fork the repository
  2. Create a feature branch
  3. Write tests for new functionality
  4. Ensure all tests pass
  5. Submit a pull request

πŸ“ Documentation

πŸ“„ License

This project is licensed under the MIT License.

πŸ™ Acknowledgments

Built with:


⭐ 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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published