Can we use JCS for distributed cache?
JCS is a very popular caching framework since early 2000s. It claims to be more faster than ehcache for heavy get operations related applications. They also claim that they can be used as distributed cache.
I used their JDBC cache for cache distribution just to realize that it acts as a backup for in memory cache and is not actually a distributed cache. Each node in JCS first checks in memory for the existence of a particular key before hitting the database. So for any first put operation, the key will be available at each node of the cluster. For any subsequent update operation, other nodes will get old data present in the memory of that node. Even for first operation, it fetches the value from database, which will be relatively a slow operation. There is no sync up between database and in-memory data of each node which I had assumed earlier.
Then I moved to TCP/UDP cache which they claim to be working well in distributed environment. You will hardly find any handy document. I had decided once I will make it working, I will blog about it. But unfortunately that never happened. Somehow I was able to make some data modifications done on one node get reflected on other nodes. But it was way to inconsistent. Few updates were getting reflected and few not. ULTIMATELY I DECIDED TO GIVE UP AND MOVE ON TO MEMCACHED AND REDIS.
In short, use JCS if distributed environment is not your priority, otherwise stay away from it