Some APIs we have. Some we don't (yet).
I thought it might be worthwhile to write down all the APIs and frameworks we are bringing down the pike. I have the following in implementation through various OSS contributors right now:
1. Write-behind API to the database. This framework, to be hosted in our Forge, will provide a simple Map-based collection plus an interface for you to implement. The interface will be called to flush your objects to a DB at some point after you call map.put() on that object. The API will encapsulate all the models of write-behind including idempotent updates, non-idempotent updates, all with and without automatic retry.
2. Write-thru API to the database. This framework, again in the Forge, will provide a simple Map-based collection and the appropriate TC + JDBC transaction logic to get a object into cache AND the database or at least just the database, safely and maintaining the database's role as system of record.
3. WAN API that will allow 2 datacenters running 2 uncoupled Terracotta-based clusters to share data. Again, this will be behind a pluggable collection for storage. Objects will be configurable such that some business updates can be flagged as synchronous replication across datacenters, while others are async, and still others are mostly-sync meaning wait for a runtime adjustable timeout to get an ACK from the other datacenter.
What do you think? Do you need this APIs? Have you been wondering how to do these things with TC? Its all going to be pure POJO and open source, housed in our forge. So you can change the implementation as well as learn from it and apply it to your use case. I think that's exciting.
An important side note. A few people exclaimed to me that while this list is nice, they need a distributed cache API too. This surprises me because we have 2 already:
1. If you have a true caching requirement where data expires or ages in the cache and eventually needs to be evicted. Use EHCache on top of Terracotta. Don't write your own evictor, please. Ours is highly tuned to keep objects off of JVMs that don't need them.
2. If you have a pseudo-caching requirement where data expires _only_ on business event, like a user or application conversational state object that expires at the end of a process flow, then just use a ConcurrentHashMap. Don't worry about EHCache, or what have you in this case.
EHCache and ConcurrentHashMap are like our Master / Worker framework or HTTPSession interface. These are officially supported APIs and usages of Terracotta. The stuff I am working on now will join these existing solutions ASAP (read: next 60 days).
Cheers,
--Ari
