Saturday, November 10, 2007

Transactional Collections

In my previous job, I was a Java developer and I was in a team that was building a Content Management System. Although there was a lot of exciting modules to work with, the ones I liked the most where a transactional map and a transactional file system.

The former was mostly used as a Cache system, where the transactional map was backed by a LRU map. We analyzed some of the Transactional Caches available in the moment, like JBossCache, but they were too much for what we needed, and in some cases they were buggy. In my opinion, once we finished it, it was an excellent map, better than the one offered by the Commons Transactions at that time. As a matter of fact, several times I thought joining the CT project to contribute by building different kind of transactional collections, like a set, sorted set, sorted map, a list, etc.

I thought about building a transactional sorted set or a list, and they seem more difficult as not only you have to keep the ACID properties for those objects added to the collection, but also keep their positions, and try to minimize the overhead.

Commons Transactions also offer a file system, but it doesn’t seem to comply with a XA interface - XAResource -. In my job both the map and the file system were managed by a JTA as they worked in conjunction with a database. Luckily, as the transactional map is a memory only collection, it isn’t necessary to keep a log and do some kind of recovery disaster in the case of a crash.

I wonder the status of transactional collections in other languages, like C++ or Smalltalk…

No comments: