expressa icon indicating copy to clipboard operation
expressa copied to clipboard

cacheInMemory with Redis

Open kane-mason opened this issue 3 years ago • 3 comments

I know expressa does have a memory cache for the storage types.. I have not tested used it or seen it used with anything other than the roles collection. I also noticed a unit test that fails when you set cacheInMemory: true so dont have huge confidence in it? Also what if you have more than one instance of your app running?

Anyway, i was researching it a bit, and i thought there may be an opportunity to cacheInMemory with redis? Since all the complexities around data consistency, transaction concurrency and instancing are taken care of?

kane-mason avatar Feb 05 '22 09:02 kane-mason

Yes, cacheInMemory: true is not intended for models which change frequently. It generally works fine for models that very rarely change like settings or collections. In cases of when you're running multiple instances, rebooting all instances is recommended after changing any data that uses cacheInMemory: true.

Having the option of a redis cache seems like a good idea to me! It probably wouldn't quite replace the in-memory cache, but would be helpful in many cases.

Are you running into performance constraints without caching or just wanting to consider scalability?

thomas4019 avatar Feb 07 '22 06:02 thomas4019

no not running into performance problems yet, but just trying to think of the future and something like redis seems to be commonly done and i thought there may be an oppurtunity for it to fit in nicely here! I am no expert on it though..

kane-mason avatar Feb 13 '22 17:02 kane-mason

Makes sense! I think this would be a nice feature too, but I think we should implement once we see a need

thomas4019 avatar Feb 20 '22 23:02 thomas4019