One row, many threads: How to avoid database duplicates in Rails applications—Martian Chronicles, Evil Martians’ team blog
A primer on avoiding duplicates in database tables that back your multi-threaded Rails applications with runnable examples
evilmartians.com