News for hackers. Stuff that matters.
Re:Redis: the AK-47 of databases by antirez on Friday January 28, 2011 @12:11PM (#2152593)
MULTI/EXEC is completely atomic and transactional.

You can perform just writes inside the block. If you want atomicity with reads in the middle, you need to use WATCH/MULTI/EXEC that uses an optimistic locking algorithm.

Re:Redis: the AK-47 of databases by IgorPartola on Friday January 28, 2011 @12:40PM (#2152695)
Ah, that makes sense. I imagine allowing atomic reads without WATCH would complicate the code quite a bit.
Re:Redis: the AK-47 of databases by antirez on Friday January 28, 2011 @02:01PM (#2153040)
Indeed, not very Redis-ish :)

With WATCH is very easy. WATCH this keys. Perform your reads. Prepare to write in a transaction. If at least one key was modified in the meantime the transaction will fail.