On Mon, May 5, 2014 at 10:27 AM, Ignacio Martin <natx...@gmail.com> wrote:
> > When a user registers, the server generates a UUID and performs an INSERT > ... IF NOT EXISTS into the email_to_UUID table. Immediately after, perform > a SELECT from the same table and see if the read UUID is the same that the > one we just generated. If it is, we are allowed to INSERT the data in the > user table, knowing that no other will be doing it. > INSERT ... IF NOT EXISTS is the correct thing to do here, but you don't need to SELECT afterwards. If the row does exist, the query results will show that the insert was not applied and the existing row will be returned. -- Tyler Hobbs DataStax <http://datastax.com/>