Reputation: 4324
I am working on a project in which I will be calling Service Fabric methods and returning the data to end user. The Data is modified very infrequently or is almost constant so I want to maintain a cache and return it if the data is not modified.
The project structure is: WepApi(Stateless Service) -> Repository -> SatefulService
What is the best way of implementing this in Azure Service Fabric? I am thinking of two options:
And, I am also having below questions.
Approach #1:
Approach #2:
Any best approaches to implement a cache in service fabric?
Thanks,
Upvotes: 0
Views: 769
Reputation: 176
Reliable Collections were designed for performance, bc they run in-process and data is kept in memory if there is enough available memory (which in your case should be ok, for ten thousand records). The only slow-down compared to a regular dictionary in memory is that a reliable dictionary must maintain transactional consistency while reading, but i presume you need this consistency anyway?
Upvotes: 1