I am a newbie of Terracotta server. According to the doc, Terracotta server provides "POJO clustering", i.e. POJOs can be shared among multiple VMs (Please correct me if I am wrong). But now we can also have Ehcache integrated into Terracotta server to archive distributed caching. So are these two features overlapped? When should we use POJO clustering or Ehcache? What additional features does Ehcache provide?
POJO clustering is the ability to share any arbitrary Java object graph - e.g. if your domain model involves a Hashmap that contains Vectors which contain ArrayLists etc. you can get replication/persistence for that graph via DSO (Distributed Shared Objects).
EHcache on the other had is a classic cache - with a well defined API. Just like DSO you get "correct" replication/persistence for the contents of the cache. Yes, you could take the domain model and dump it into an EHcache and achieve replication amongst JVMs/ Persistence like you did with DSO. However, the API supports several "cache" features like Event Listeners, Eviction, Bulk Loading etc... See ehcache.org and terracotta.org (for DSO) for the capabilities of each.