Race Conditions & ActiveRecord Uniqueness Validation

Wikipedia has a good definition for race conditions but I prefer this one from Search Storage — that I tweaked it just a bit.

A race condition is an undesirable situation that occurs when a device or system attempts to perform two or more operations at the same time, but because of the nature of the device or system, the operations must be executed in the proper sequence to be done correctly.

Uniqueness validation ensures that the value of the specified attributes are unique across the system. In Rails, you’d…



Human | www.mattwal.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store