2

It will be good if some one can describe the main adv. and disadv. of using ehcache and oracle coherance as RI of JCache API. Of course it could be done by learning each framework separatly.

But to see a whole picture from the top I think it can be usefull. And to understand, what is the main purpose of using cahce instad of collections in java as it also stores in memory.

DavidPostill
  • 7,734
  • 9
  • 41
  • 60
slisnychyi
  • 1,832
  • 3
  • 25
  • 32

1 Answers1

1

It's not true that it stores only in memory - caching solutions can offload data into persistent storage (disk/database).

Few of common features that make cache more rich than java collections:

  • JTA transactions participation
  • offloading into persistent storage (various policies when and what)
  • automatic expiration
  • listeners for cache events (sync/async)
  • indexing (query values in the map) and fulltext search

Caches are also often combined with distributed grids, where you get:

  • throughput scaling
  • failover handling (grid keeps multiple copies of data)
  • distributed computing (usually MapReduce-based, or distributed task executors)

Usually you can also manage the caches using JMX, CLI or web interface.

Radim Vansa
  • 5,686
  • 2
  • 25
  • 40