Java, nosql, mongodb, howto technologies

Java driver for MongoDB does not provide any utility classes that could help with building update queries. If you want to create a query to update or increment field values, you usually have to use BasicDBObjectBuilder. This is intuitive approach, but queries defined in such a way are quite hard to read and maintain.

Java, nosql, persistent queue technologies

Recently I had a task to develop the application which will have large work queue and which need to survive the restarts. The application need to be lightweight. After trying several different persistent engines for Java I''ve chosen to stick with Berkley DB Java edition. This persistent engine is pretty lightweight it is fast, optimized for multi-threaded usage and have no problems with reclaiming free space.

As I needed the fast persistent queue at a cost of possible data loss on system crash I've chosen non-transactional API for Berkley DB. With non-transactional API the great speed can be achieved for persistent queue at a price of loss of some data at system crash. The more data you allow to be lost the greater speed of the queue you will have. Though you can opt to sync to disk each operation on the queue and in that case your data loss will be minimal.

Grails, mongodb, nosql technologies

If you are going to use mongodb for production grails application you might stuck with the issue that replica set is really not supported by current version 1.0.0.M1 of mongodb plugin.

It is quite surprising because mongo java driver supports replica set configuration quite fine.

The problem is that GORM plugin is built on top of version 0.5.1 of gmongo library which doesn't support replica set. Only current development version 0.7 of gmongo library supports this feature.