Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Does anyone know what is the concurrency control used by Redis? I couldn't find anything related to transaction isolation in the docs.


Many of the operations are documented as being atomic - you can get a surprisingly long way using atomically incrementing counters and atomic set operations. If you search through the Redis mailing list there are some interesting discussions around lock-free algorithms, CAS and potentially adding a LOCK command. There's also a recently commited SETNX command for atomically applying a number of changes to a set of keys at once.


Lock-free algorithms can be very fast, but they are also hard to implement. It seems Redis is going to get some lock-based pessimistic concurrency control eventually:

http://groups.google.com/group/redis-db/browse_thread/thread...


Indeed there are plans for LOCK / TRYLOCK and UNLOCK. It's just a matter of time, because from the feedbacks from the community it seems like sorted sets and hashes are the priority, together with strategies to improve the memory usage.

For instance Redis edge (the latest git version) is able to save a lot of RAM (more or less 25%) encoding in a particular way objects that can be represented as integers internally, but there is still a lot of work to do in this regard.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: