3 ms·
Yeah, if you need to do things across processes then something like Redis or memcached might be necessary. The thing that bothers me is people adding it in pla
by tombert 2y ago
Yeah, if you need to do things across processes then something like Redis or memcached might be necessary.
The thing that bothers me is people adding it in places that don't make sense; I mentioned in a sibling thread that the I've seen people use it as a glorified global variable in stuff like Kafka streaming. Kafka's stuff is already partitioned, you likely don't gain anything from Redis compared to just keeping a local map, and at that point you can just use a Guava Cache and let it handle invalidation in-process.
- koolba 2y agoNot just across concurrent processes, but also serial ones. Externalizing a cache into something like Redis lets you bounce your process with no reload time. You can get around it for some things like web sessions with a signed cookie, but that opens up expiration and invalidation issue. But that doesn’t work for caching non trivial calculations or intermediate state. There’s a sweet spot for transitory persistence.