beanie
beanie copied to clipboard
Caching on Multi Process applications
The cache is currently limited on single process applications.
Example: You fetch and cache document x on process 1 and fetch it also on process 2. If you modify the document on process 1 and fetch it afterwards on process 2 it will probably use the old cached version.
Possible solutions:
-
Allow clearing cache:
You could create actions which initiate a cache clear for all other processes trough ipc for example. So if you do any action on Document x on process 1, all cached entries related to Document x's ID will be cleared on process
-
Cache Drivers:
Implement (async) cache drivers which allow using 3rd party cached like Redis or allow custom cache implementations.
Just found #275 even trough the progress has been slowed down and it got a mayor problem. It's doesn't support async Caches. I use beanie as I want an async odm, but this would introduce a sync Redis client which could cause blocking code.
Hey. Yup, this makes sense. I'll add an async interface for custom caches.
This issue is stale because it has been open 30 days with no activity.
This issue was closed because it has been stalled for 14 days with no activity.
Hey, i was wondering, if you are still planning to add that interface for custom caches?