ben-manes / caffeine

A high performance caching library for Java
Apache License 2.0
15.85k stars 1.59k forks source link

can support subkey like the hash of redis? #1677

Closed sunshio closed 6 months ago

ben-manes commented 6 months ago

I’m not familiar with redis but basically caffeine is a bounded ConcurrentMap. If you want something beyond a key-value mapping then you’ll need to build that on top.

A lot of redis functionality comes by using a single lock for all read writes, so it can do more complex data models but slower, relying on sharding for performance and that network hops are a bottleneck that hides its own cost. As a concurrent in process cache, we don’t have the same flexibility and users expect higher performance.