A common pattern, for example, is using on-heap caches together with off-heap caches/dedicated cache servers (like Redis) in L1/L2/Lx model. Here, the on-heap cache serves as the service's first line of defense, protecting slower, larger caches/databases from excessive load.
And, to clarify, I was only thinking about localhost/Unix sockets to mostly eliminate network latency. Anything external to the server would obviously be incomparably slower.
I also suppose that it would be interesting/useful to compare the speed of these in-memory caches to Golang caches/kv stores that have disk persistence. Obviously the type of "disk" would matter significantly, with nvme being closer in perf (and probably sufficient for most applications)
Anyway, it was just a thought.
Out of curiosity, has any benchmarking been done to compare Otter etc vs things like (localhost/Unix socket) Redis?