Welcome to the JBoss/Caches forum !
This forum is used to discuss the design/implementation of the new caching subsystem for JBoss.
What is the caching susbsystem?
A replicated cache whose contents will be the same across all nodes of a caching cluster. When an entry is added to the cache of one node, it will be replicated to all nodes. Reads are always local.
Where will it be used ?
Primary target is a cache for entity beans. The idea is to have a write-through cache for entity beans, with reads being purely local (from the cache), thus improving performance by eliminating access to the DB for read-only methods.
But there are many places where it can be used, e.g. clustered JMS.
What is the structure ?
Not yet decided. Possibly a map-like structure, but it could also be a tree.
What are the semantics ?
- Asynchronous replication: put the update on the JavaGroups channel (see www.javagroups.com for info) and return immediately.
- Synchronous replication: propagate the update to all nodes and wait for all replies (excluding crashed members). This will ensure that all nodes have applied the update before we update another node.
- Serialized synchronous replication: same as above, but provide total serialization, e.g. make sure that, if the same data is simultaneously modified on separate nodes of the cluster, the updates are serialized, e.g. everybody gets updates from all nodes in the same order. We'll use locks to do this. Issues: first version will use timeouts, later versions should use deadlock detection
How do I go about implementing this ?
First stage: design and implementation of the building block described above (in JavaGroups).
Second stage: provide an implementation of the JCache (JSR 107) interface in JBoss. This implementation would use the above JavaGroups building block, and probably will be an MBean
Third stage: implement an entity bean cache using the above MBean.
I'll post the JavaGroups building block once I have a usable interface so people can comment.