You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+13-13
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,9 @@
4
4
5
5
## How to use
6
6
7
-
OrleansCassandraUtils is Orleans 2.0 compatible.
7
+
OrleansCassandraUtils is Orleans 3.x compatible.
8
8
9
-
To set it up, you first need a working Cassandra DB. Create a new keyspace and run the `InitializeOrleansDatabase.cql` script on it. Note that unlike the ADO.Net provider, you can't put data from multiple clusters into one database/keyspace. You **must** create a new keyspace for each cluster.
9
+
To set it up, you first need a working Cassandra DB. Create a new keyspace and run the `InitializeOrleansDatabase.cql` script on it. Note that unlike the ADO.Net provider, you can't put data from multiple clusters into one database/keyspace. You must create a new keyspace for each cluster.
10
10
11
11
OrleansCassandraUtils uses a custom connection string format not unlike SQL Server connection strings. The parameters (case-insensitive) are as follows:
12
12
@@ -23,41 +23,41 @@ Then, setup your silo as follows:
23
23
24
24
### Grain storage
25
25
26
-
```
27
-
new SiloHostBuilder().AddCassandraGrainStorageAsDefault((CassandraGrainStorageOptions o) =>
You'll notice the `AddSerializationProvider` call above is unfamiliar. This is an optional feature you can use to provide your own serialization provider, either based on existing providers in Orleans or a new one altogether. You may add up to 127 providers, each with a unique code between 0 and 126. These codes must not change during the entire lifetime of a cluster, as the codes are stored alongside the data and then used to decide which deserializer to use when reading data back from the database. If you don't provide any custom serializers, Orleans' default serializer will be used. Beware however that the default serializer is **not** version-tolerant and you **will** break your entire DB if you make a change to any grain state classes. To implement a custom serializer, simply implement the `OrleansCassandraUtils.Persistence.IStorageSerializationProvider` interface.
34
+
You'll notice the `AddSerializationProvider` call above is unfamiliar. This is an optional feature you can use to provide your own serialization provider, either based on existing providers in Orleans or a new one altogether. You may add up to 127 providers, each with a unique code between 0 and 126. These codes must not change during the entire lifetime of a cluster, as the codes are stored alongside the data and then used to decide which deserializer to use when reading data back from the database. If you don't provide any custom serializers, Orleans' default serializer will be used. Beware however that the default serializer is not version-tolerant and you *will* break your entire DB if you make a change to any grain state classes. To implement a custom serializer, simply implement the `OrleansCassandraUtils.Persistence.IStorageSerializationProvider` interface.
35
35
36
-
It's also worth mentioning that all grain state is serialized as binary data, since I find XML and JSON to be very inefficient, space- and perfomance-wise ([see](http://geekswithblogs.net/LeonidGaneline/archive/2015/05/06/serializers-in-.net.-v.2.aspx)[here](https://auth0.com/blog/beating-json-performance-with-protobuf/) for example). If you need text serialization, you can turn the resulting string into a UTF-8 byte sequence, though I would recommend against this approach. I prefer [Bond](https://github.com/Microsoft/bond), but you should also check out[Protobuf](https://developers.google.com/protocol-buffers/docs/overview).
36
+
It's also worth mentioning that all grain state is serialized as binary data, since I find XML and JSON to be very inefficient, space- and perfomance-wise ([see](http://geekswithblogs.net/LeonidGaneline/archive/2015/05/06/serializers-in-.net.-v.2.aspx)[here](https://auth0.com/blog/beating-json-performance-with-protobuf/) for example). If you need text serialization, you can turn the resulting string into a UTF-8 byte sequence. I prefer [Bond](https://github.com/Microsoft/bond), but you can also use[Protobuf](https://developers.google.com/protocol-buffers/docs/overview).
37
37
38
38
### Clustering
39
39
40
40
On the silo side:
41
-
```
42
-
new SiloHostBuilder().UseCassandraClustering((CassandraClusteringOptions o) =>
@@ -67,7 +67,7 @@ new SiloHostBuilder().UseCassandraReminderService((CassandraClusteringOptions o)
67
67
68
68
Cassandra clusters can be a good place to store your non-grain data as well. OrleansCassandraUtils provides the `OrleansCassandraUtils.Utils.CassandraSessionFactory` class, which you may use to acquire a Cassandra session and make custom queries against your cluster as follows:
0 commit comments