JonPSmith / Net.DistributedFileStoreCache

NET distributed cache using a json file as the shared resourse with very fast Get
https://www.thereformedprogrammer.net/a-net-distributed-cache-with-a-25-nanosecond-read-time/
98 stars 9 forks source link

Using with Kubernetes Persistent Volume #4

Closed kimbirkelund closed 1 year ago

kimbirkelund commented 1 year ago

First of, nice lib 👍

I trying to use this with Kubernetes using a Persistent Volume for storage. The basics are working - the cache file is updated. However updates does not seem to get propagated to the other instances. I'm guessing it is FileSystemWatcher that does work.

Do you have experience using the lib in Kubernetes?

JonPSmith commented 1 year ago

Hi @kimbirkelund,

I don't use Kubernetes so I can't really help, but I doubt that Kubernetes supports the FileSystemWatcher event.

Sorry I can't help.

kimbirkelund commented 1 year ago

You're right - it does not support events. I got around this by using reflection to mark the local cache as invalid (I could live with the degraded performance for now).

However it turns out locking also does not work as it needs to so the JSON file gets corrupted when there are concurrent writes.

Oh well, Redis it is :)