couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Uvarov <alexander.uva...@gmail.com>
Subject Re: Validate uniqueness field
Date Sun, 28 Mar 2010 12:33:51 GMT

On 28.03.2010, at 14:40, faust 1111 wrote:

> Its sounds like pair of crutches ;)

Agree with you. Lack of uniqueness, lack of transactions makes couch completely useless for
most cases. Solutions like multiple docs with _id as unique key, along with "inventory tickets"
sounds insane.

I invented simple solution with Redis. Just an idea. You can use Redis setnx, msetnx operations
to lock desired documents, or just lock "User" by giving this string as key in Redis to lock
whole User type. Then just try to lock "User", create your User document, unlock. If there
is already a lock, wait and try again. But deadlocks are possible when process that owned
the lock is dead and no one can release a lock.
Redis commands: http://code.google.com/p/redis/wiki/MsetCommand

I am wondering why not introduce locking in couchdb. Couchdb is designed to be extremely fast,
but there are also real world problems. Awesome technology, I am crying that such restrictions
taking it away.
Mime
View raw message