page banner
avatar
'Technology Migration: How to Change Database on the Live Website' post illustration
Technology Migration: How to Change Database on the Live Website

Let's look how we've switched from NoSQL to SQL database on the live project and multiplied the loading speed without interrupting the production.

avatar
'MongoDB java driver. The custom builder for update operations.' post illustration
MongoDB java driver. The custom builder for update operations.

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.

avatar
'Lightweight fast persistent queue in Java using Berkley DB' post illustration
Lightweight fast persistent queue in Java using Berkley DB

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.

avatar
'Fixing support of replica set by Grails mongo plugin' post illustration
Fixing support of replica set by Grails mongo plugin

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.