Open kane-mason opened 2 years ago
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?
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..
Makes sense! I think this would be a nice feature too, but I think we should implement once we see a need
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 setcacheInMemory: 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
withredis
? Since all the complexities around data consistency, transaction concurrency and instancing are taken care of?