OrleansContrib/OrleansCouchbaseProvider

Add the possiblity to store short type names

Opened this issue · 4 comments

I am converting a project's data to use CouchBase since the other database i was using had issues and this plugin is now mature enough thanks to contribution of others. I'll be able to hopefully contribute again.

As a first step i need to be able to store types without their namespace in storage provider. @MikeGoldsmith Is the best way to do it , storing it as a config option in the dictionary? Is it a good idea to add such a feature to the main branch? Actually it has advantages in cases of long namespace and type names. What do you think?

When we support Orleans 2.0 then we'll have a ASP.NET core like config and things will be different but i need this as a first step for my return. I'm a reborn couchbase-ian if that's a thing (not true actually since i always knew couchbase is a good database and it was my first choice but due to a bug in this provider i wrote and need for a more complete viewer and lack of time at the situation back then i had to switch ) :)

Hey @ashkan-saeedi-mazdeh - good to hear you're back to using Couchbase. This project had gone a little stale but I expect to get more time to contribute over the coming weeks.

For your use-case, do you mean document key's not to include full namespace, or the properties within the JSON? Can you provide an example of what you want it to look like?

@MikeGoldsmith I mean the type name in document keys and in the _type or type key in the JSON document itself.
I have multiple storage classes for my grains in Orleans and some of them are in different namespaces, I want to be able to freely move them around just because we have not been careful when making it in the beginning (some storage classes/states are in our interfaces project and some in collection/implementation). In my other storage provider i made it work by including the type name itself only in the document key and type key in the JSON document.

Other use-cases for this include very long namespace/nested classes which their name would be bigger than the allowed 255 bytes which couchbase allows (or 250, i don't exactly remember). Specially with generic state classes it can become an issue as well so in general i think this is a good option.

Regarding general development, two thigns i would like to see are , reminders support and ability to store state as binary data in couchbase which is at least very important in game related stuff. I don't know if i would get the time to do it or not. A friend of mine also ported this to .NET core but unfortunately sent a PR to my old not updated fork of it.

Maybe you can take a look ashkan-saeedi-mazdeh/OrleansCouchBaseProviders#1

I'll have a think about how we could manage shorter document keys.

Document types in the JSON is dependent on your serializer settings and now linked to Couchbase directly. The default setting for JSON.Net is to not include serialized type.

I remember you raising the binary blob feature request before - the Couchbase SDK ships a BinaryTranscoder in net45 so we're good there.

I've started look at both upgrading the current project to be netstandard compatible and also breifly looked at the 2.0 Orleans APIs which themselves are based on netstandard 2.0. Netstandard 1.x should be short-term, 2.0 will be a longer term goal.

Ok then i should take a good look at the codebase tomorrow since i need to convert our data from arangoDB to couchbase in a way that grains can read them.