Chad Remesch bio photo

Chad Remesch

Entrepreneur, developer, and software engineer

Email LinkedIn Github

What is it?
Officer is an easy to use distributed lock server and client written in Ruby.  Wikipedia calls it a Distributed Lock Manager (DLM).

Why would I use it?
You use it to prevent race conditions in your distributed applications.  It can be used with any Ruby app including Rails.  Officer helps you coordinate access to shared resources in a predictable way since a lock can be held by only one client at a time.  Other clients will queue in an orderly fashion and wait their turn.

How did it come about?
Back in 2009, my company wrote a Facebook game named Starfleet Commander.  It's a highly competitive, massively multiplayer, real time strategy game.  In other words, it's a Ruby on Rails application that encourages customers to find and exploit race conditions.  I wrote Officer so that I could fix this problem with minimal changes to the game code.

Is it only useful for games?
Although it was originally designed for a game, it can be used with any application that needs distributed exclusive locks.  Most typical web apps don't benefit from Officer since there is little purpose in exploiting their race conditions.

What are the alternatives?
Officer was originally inspired by Elock.  Unfortunately for me, I encountered a serious memory leak in Elock and thus Officer was created.  In many cases, messaging infrastructure is a better choice than a lock server.  One such product is RabbitMQ.  This wasn't an option for Starfleet Commander since it would have required significant re-architecting of the code base.

What about languages other than Ruby?
Officer's network protocol is a very simple JSON syntax so it should be relatively straightforward to port the client to other languages.  Please contribute them if you have the time.

How do I find out more?
Check out Officer on Github for installation and usage instructions.  Feel free to contact me if you have questions or find problems with it.  My email is under my picture.