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
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>
If using SQLServer proper, create an empty database and make sure the connecting user has the following permissions
[db_datareader]
[db_datawriter]
[db_ddladmin]
The following attributes can be used on the <Provider/>
tag to configure the provider:
false
, if set to false
the Orleans binary serializer is used. If set to true
json data is serialized. if set to both
then both json and binary data is produced and persisted, but the binary data is used for deserialization(meant for debugging purposes).any standard SQL Server connection string
)