Orleans.Clustering.CosmosDB 1.0.0-preview-1

This is a prerelease version of Orleans.Clustering.CosmosDB.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Orleans.Clustering.CosmosDB --version 1.0.0-preview-1                
NuGet\Install-Package Orleans.Clustering.CosmosDB -Version 1.0.0-preview-1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Orleans.Clustering.CosmosDB" Version="1.0.0-preview-1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Orleans.Clustering.CosmosDB --version 1.0.0-preview-1                
#r "nuget: Orleans.Clustering.CosmosDB, 1.0.0-preview-1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Orleans.Clustering.CosmosDB as a Cake Addin
#addin nuget:?package=Orleans.Clustering.CosmosDB&version=1.0.0-preview-1&prerelease

// Install Orleans.Clustering.CosmosDB as a Cake Tool
#tool nuget:?package=Orleans.Clustering.CosmosDB&version=1.0.0-preview-1&prerelease                

<p align="center"> <img src="https://github.com/dotnet/orleans/blob/gh-pages/assets/logo.png" alt="Orleans.CosmosDB" width="300px"> <h1>Orleans CosmosDB Providers</h1> </p>

CircleCI NuGet NuGet NuGet Gitter

Orleans is a framework that provides a straight-forward approach to building distributed high-scale computing applications, without the need to learn and apply complex concurrency or other scaling patterns.

Azure CosmosDB is Microsoft's globally distributed, multi-model database. It is a database for extremely low latency and massively scalable applications anywhere in the world, with native support for NoSQL.

Orleans.CosmosDB is a package that use Azure CosmosDB as a backend for Orleans providers like Cluster Membership, Grain State storage, Streaming and Reminders.

Installation

Installation is performed via NuGet

From Package Manager:

PS> Install-Package Orleans.Clustering.CosmosDB -prerelease

PS> Install-Package Orleans.Persistence.CosmosDB -prerelease

PS> Install-Package Orleans.Reminders.CosmosDB -prerelease

.Net CLI:

# dotnet add package Orleans.Clustering.CosmosDB -prerelease

# dotnet add package Orleans.Persistence.CosmosDB -prerelease

# dotnet add package Orleans.Reminders.CosmosDB -prerelease

Paket:

# paket add Orleans.Clustering.CosmosDB -prerelease

# paket add Orleans.Persistence.CosmosDB -prerelease

# paket add Orleans.Reminders.CosmosDB -prerelease

Configuration

It is not mandatory to use all the providers at once. Just pick the one you are interested in from the samples and you should be good as they don't depend on each other.

Silo

We need to configure the Orleans Silo with the below:

  • Use .UseCosmosDBMembership() on ISiloHostBuilder to enable cluster membership.
  • Use .AddAzureCosmosDBPersistence() on ClusterConfiguration to register the grain state persistence provider.
  • Use .UseAzureCosmosDBPersistence() on ISiloHostBuilder to configure the grain state persistence provider.
  • Use .AddAzureCosmosDBReminders() on ClusterConfiguration to register the reminders provider.
  • Use .UseAzureCosmosDBReminders() on ISiloHostBuilder to configure the reminders provider.

Example

var siloConfig = new ClusterConfiguration();
siloConfig.AddAzureCosmosDBPersistence("myProvider"); //Register the persistence provider.
siloConfig.AddAzureCosmosDBReminders(); // Register the reminders provider.

var silo = new SiloHostBuilder()
    .UseConfiguration(siloConfig)
    .UseCosmosDBMembership() // Use CosmosDB as the cluster membership table.
    .UseAzureCosmosDBPersistence() // Configure CosmosDB persistence provider.
    .UseAzureCosmosDBReminders() // Configure CosmosDB reminders provider.
    .Build();
await silo.StartAsync();

Client

Now your client application needs to connect to the Orleans Cluster by using configuring the Gateway List Provider:

  • Use .UseCosmosDBGatewayListProvider() on IClientBuilder.

Example

var clientConfig = new ClientConfiguration();

var client = new ClientBuilder()
    .UseConfiguration(clientConfig)
    .UseCosmosDBGatewayListProvider() // Use CosmosDB as the Gateway list provider.
    .Build();
    await client.Connect();

Great! Now you have Orleans configured to use Azure CosmosDB as the back storage for its providers!

Contributions

PRs and feedback are very welcome!

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
3.0.4 51,009 6/16/2021 3.0.4 is deprecated because it is no longer maintained.
3.0.3 2,245 4/24/2020
3.0.2 585 3/23/2020
3.0.1 812 1/29/2020
3.0.0 770 11/14/2019
1.3.0 987 4/3/2019
1.2.1 763 3/20/2019
1.2.0 755 3/19/2019
1.1.42 1,358 9/28/2018
1.1.41 855 9/28/2018
1.1.40 1,169 3/28/2018
1.1.38 1,064 3/28/2018
1.1.0-rc2-36 885 3/13/2018
1.1.0-rc1-34 901 3/12/2018
1.1.0-rc1-29 898 2/27/2018
1.0.1-preview-27 878 2/10/2018
1.0.1-preview-25 915 2/5/2018
1.0.1-preview-21 853 2/1/2018
1.0.1-preview-19 895 2/1/2018
1.0.0-preview-9 945 2/1/2018
1.0.0-preview-8 922 2/1/2018
1.0.0-preview-7 959 2/1/2018
1.0.0-preview-17 869 2/1/2018
1.0.0-preview-16 903 2/1/2018
1.0.0-preview-14 919 2/1/2018
1.0.0-preview-1 1,005 2/1/2018