Easy distributed locks using Redis

Wombat is a very concurrent application. It runs on multiple hosts, processes and threads, and sometimes we need to lock an execution to be exclusively performed across all threads, no matter the host or process. As any other distributed application, we can’t use a simple Ruby Mutex, so we implemented a Mutex using Redis, which can be shared across all threads.

We decided to use Redis, because it’s fast, consistent and has two super useful commands for locking: SETNX and EXPIRE.

Read the full post: Easy distributed locks using Redis