0

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

leventov
  • 14,760
  • 11
  • 69
  • 98
John Caron
  • 47
  • 4
  • If memory mapped, then the disk page is acting as a cache. But you pay the price of deserialization. I suppose it you are sharing the file among processes, theres no easy way to keep the guava cache synced. So this idea might only be useful in a single process. – John Caron Mar 29 '15 at 00:24

1 Answers1

1

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.

Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130