OrleansContrib / Orleans.StorageProviders.SimpleSQLServerStorage

Ultra low friction Orleans Storage Provider using SQLServer
MIT License
13 stars 8 forks source link
entity-framework orleans orleans-storage-provider sql-server

Orleans.StorageProviders.SimpleSQLServerStorage

Build status

NuGet

A KeyValue SQLServer implementation of the Orleans Storage Provider model. Uses an EF code-first table to store grain keys with binary and/or json serialized data

Usage

Install-Package Orleans.StorageProviders.SimpleSQLServerStorage

Decorate your grain with the StorageProvider attribute e.g.

[StorageProvider(ProviderName = "PubSubStore")]

in your OrleansConfiguration.xml configure the provider like this:

<StorageProviders>
      <Provider Type="Orleans.StorageProviders.SimpleSQLServerStorage.SimpleSQLServerStorage" Name="PubSubStore"
                ConnectionString="Data Source=(LocalDB)\v11.0; Integrated Security=True;"
                UseJsonFormat="false" />

      <Provider Type="Orleans.StorageProviders.SimpleSQLServerStorage.SimpleSQLServerStorage" Name="SomeOtherGrainStorage"
                ConnectionString="Data Source=(LocalDB)\v11.0; Integrated Security=True;"
                UseJsonFormat="both" />
    </StorageProviders>

Setup

If using SQLServer proper, create an empty database and make sure the connecting user has the following permissions

[db_datareader]
[db_datawriter]
[db_ddladmin]

Configuration

The following attributes can be used on the <Provider/> tag to configure the provider: