Replies: 1 comment 4 replies
-
Hi @steveoh , thanks for sharing your scenario!
Let's see what I can do 🙂
First thing to notice is that I suppose this bg service would run in the same app that will use FusionCache.
Can you help me understand this part better?
Ok, for this you have 2 ways:
One of these 2 approaches should cover this part.
Correct.
For my understanding of the scenario: yes, it looks good!
Eh, there are scenarios that are not necessarily 100% this or 100% that, but more like middle grounds. Hope this helps! |
Beta Was this translation helpful? Give feedback.
-
I have a need to seed an L1/L2 cache from a BigQuery table. BigQuery has restrictive transactional quotas since it's an analytics database so acting as a "normal" data source for a cache is not a good fit.
I white boarded some ideas and I'd like to share them to see if fusion is a good match and if there is a clean path forward and possibly one that is not uncommon. I'm excited to replace my current implementation to get all the wonderful features of fusion including stampede protection.
I was thinking about using a dotnet background service to query BigQuery on startup and seed the L1 and L2 memorystore/redis cache. This would involve inserting < 5000 items. This data is necessary for the application to function and refreshes weekly.
Every request to the api will take a piece of user input and look for an item in the cache. There are occasions where the input is not going to exist and should be set to empty. This is analogous to checking the spelling of a word in a dictionary and if the input is incorrect the app won't have an answer for it. Therefore there is no reason to query the datasource as it won't have an answer.
In certain scenarios when a cache miss happens, we want to get all the keys, which I assume we will duplicate in one cache entry for ease of access, and perform a Levenshtein distance to the values and add a new cache entry if we find one that matches closely. I assumed we could do that in the code of the cache.GetOrSetAsync method by accessing the L1 or L2 cache values?
Matches to the cache will simply follow the standard route and return the data associated.
Let me know if this makes sense and I can clear up any confusion. I'd like to confirm this is a good candidate for fusion.
As I write this out, it's starting to sound more like dynamic/remote configuration than something that requires a hybrid cache. 🤔
Beta Was this translation helpful? Give feedback.
All reactions