beanie icon indicating copy to clipboard operation
beanie copied to clipboard

Caching on Multi Process applications

Open Luc1412 opened this issue 2 years ago • 2 comments

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:

  1. 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

  1. Cache Drivers:

Implement (async) cache drivers which allow using 3rd party cached like Redis or allow custom cache implementations.

Luc1412 avatar Jul 27 '22 07:07 Luc1412

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.

Luc1412 avatar Jul 27 '22 07:07 Luc1412

Hey. Yup, this makes sense. I'll add an async interface for custom caches.

roman-right avatar Aug 19 '22 14:08 roman-right

This issue is stale because it has been open 30 days with no activity.

github-actions[bot] avatar Dec 22 '22 02:12 github-actions[bot]

This issue was closed because it has been stalled for 14 days with no activity.

github-actions[bot] avatar Jan 05 '23 02:01 github-actions[bot]

Hey, i was wondering, if you are still planning to add that interface for custom caches?

deejaypro avatar May 06 '23 14:05 deejaypro