Open marjum opened 7 years ago
Hi @marjum - Yeah, this is something I have intended to look at.
I think adding both support for a complete Couchbase config section and be able to split the server parameter would offer the most versatility.
@MikeGoldsmith Speaking of configuration, another desired config not related to this is the ability to store some state as binary data instead of JSON. Actually this is one nice advantage of Couchbase over many other NoSQL databases so please keep an eye on that too if you think it can be interesting.
The StorageProvider attribute has a property which indicates if the serialization should be to JSON or not and Orleans has a binary serializer SerializationManager
which can serialize data to binary in a none-backward compatible manner. That is one option and there are many others as well.
All these said I'm currently not using the provider but I had a plan to support this since it was useful for me back then at least.
@ashkan-saeedi-mazdeh The SDK client supports binary storage by either:
I think option 1 would be best as it offers the most options going forward. I've created issue #11 to add binary storage support.
@MikeGoldsmith Great! Yes I knew the SDK supports it so it just needs to be added to the provider. I'm closing this.
@ashkan-saeedi-mazdeh please can you re-open this issue so we can track full Couchbase config integration?
@MikeGoldsmith sorry for my confusion. Yup
@ashkan-saeedi-mazdeh Thanks 👍
The storage provider's configuration currently allows specification of a single Couchbase node URI, like so:
<Provider Type="Orleans.Storage.OrleansCouchBaseStorage" Name="CouchbaseStorage" Server="http://192.168.99.100:8091" UserName="" Password="" BucketName="orleans_storage" />
It does not seem possible however to specify multiple Couchbase cluster nodes into the same configuration. Looking into the code base, the provider's
Init
method adds the configuredServer
property as a single entry into the client configuration'sServers
list:var server = config.Properties["Server"];
.
.
clientConfig.Servers.Add(new Uri(server));
Granted that as long as the specified node is up when the client attempts to connect, it receives server configuration of the cluster's current state, including the current node list. However client connectivity is expected to fail if the configured node were to be down, or if it were to be outside of the cluster at the time.
Perhaps as an alternative, the provider configuration could allow Couchbase client configuration to be specified into app.config, enabling full configuration in addition to the required nodes list. (e.g, bucket options, connection pooling)