Skip to content
This repository has been archived by the owner on Jul 9, 2023. It is now read-only.

Is there any reason why the IndexingMode is set to Consistent? #53

Open
cdemi opened this issue Aug 20, 2021 · 2 comments
Open

Is there any reason why the IndexingMode is set to Consistent? #53

cdemi opened this issue Aug 20, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@cdemi
Copy link

cdemi commented Aug 20, 2021

I am referring to:

var stateCollection = new ContainerProperties(this._options.Collection, DEFAULT_PARTITION_KEY_PATH);
stateCollection.IndexingPolicy.IndexingMode = IndexingMode.Consistent;
stateCollection.IndexingPolicy.IncludedPaths.Add(new IncludedPath { Path = "/*" });
stateCollection.IndexingPolicy.ExcludedPaths.Add(new ExcludedPath { Path = "/\"State\"/*" });

From my understanding of the code, the Orleans.Persistence.CosmosDB Storage Provider always does point reads (only using ID and Partition Key); so it uses CosmosDB as a KV Store and never queries using the indexed values.

We are trying to optimize our CosmosDB usage and it looks like for indexing CosmosDB charges you extra RU/s. I was wondering if we could just go ahead and turn off indexing and this library would still work correctly.

As far as I can see it would, but I'm wondering if there is any reason that I'm missing

@ReubenBond
Copy link
Contributor

cc @galvesribeiro
I think this should be configurable for the persistence provider, assuming that persistence does not require consistent indexing

@galvesribeiro
Copy link
Member

You both are right. That should be configurable.

@cdemi do you mind make a PR making it configurable?

@galvesribeiro galvesribeiro added the enhancement New feature or request label Aug 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants