Search code examples
chroniclechronicle-map

Put a on-heap cache in front of chronicle


Wouldnt it make sense to put an on-heap cache (eg guava cache) in front of a persistent off-heap chronicle cache? So, use the chronicle cache when you get a guava cache miss?

Thanks


Solution

  • When a Chronicle-Map is updated either in process or via replication, you will be called by the MapEventListener which you define when you build the map.

    It is a known issue that you don't get events triggered when another process updates the map, although you will be able to get the updated value.

    Note: if the cost of deserialization is high, there is often something you can do to reduce this cost, such as using BytesMarshallable or a generated DataValue reference to use the data in place i.e. without deserializing it.