Update API documentation to clarify which APIs cache data, memory implications & relevant ReplicatorConfig settings as per this request: https://github.com/Azure/service-fabric-issues/issues/1427
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Thanks for the feedback! I have assigned the issue to the content author to investigate further and update the document as appropriate.
CC @aljo-microsoft @masnider
@MedAnd
API documentation is here for Reliable Collections:
https://docs.microsoft.com/dotnet/api/microsoft.servicefabric.data.collections?view=azure-dotnet
@aljo-microsoft - for full details please refer to production support request ID 119012524000319 which we are still working through with @zuhairp assistance.
In summary this request is to update the public documentation for all ReliableDictionary APIs to clarify the affect on memory of calling different Reliable Collection methods.
For example:
PS. Hope the above makes sense?
@preethasubbarayalu
Could you provide content for this question?
Friendly ping... any update 😎 ?
@MedAnd, We've assigned one of our SMEs to take a look at augmenting the doc and hope to have another update soon.
@MedAnd
Does TryGetValueAsync(ITransaction, TKey) cache the TValue of a TKey in memory?
Yes
Does ContainsKeyAsync(ITransaction, TKey) cache the TValue of a TKey in memory etc?
All the keys are in memory always. Value are removed from memory depending upon sweep policy.
In ContainsKeyAsync, TValue is not loaded so it is not cached.
Does CreateKeyEnumerableAsync(ITransaction) cache the TValue of a TKey in memory or is each TKey/TValue pair loaded from storage per iteration and never cached by default?
CreateKeyEnumerableAsync only iterates over keys, which are always in memory in today's implementation. So, values are not loaded in this API calls.
See tstore.cs CreateKeyEnumerableAsync, especially ReadMode.Off which means don't read value.
In CreateEnumerableAsync which returns key and values, we only read values but don't cache it, otherwise, we will have to cache the whole db as we are enumerating over all keys/values. See, Readmode.ReadValue at tstore.cs CreateEnumerableAsync
The third enum of ReadMode is CacheResult which is used when you read only one key as here
@MedAnd, I believe the above response should satisfy the question.
@Nickomang - will the above clarification be expanded & included in the official Service Fabric documentation & best practices?