database replication for new user signup

Posted by Jeff Storey on Server Fault See other posts from Server Fault or by Jeff Storey
Published on 2012-03-21T04:57:43Z Indexed on 2012/03/21 5:31 UTC
Read the original article Hit count: 517

Filed under:
|

I have a database that stores the users of my application. When a new user signs up, a record is inserted into the database for that user. I have a replicated version (slave) of this database (using mysql for now).

What I'm concerned about is this scenario:

step 1: user signs up and user record is inserted into the database

step 2: user then tries to login, and the login process queries the database for the user. however, this query hits the slave database, but the user record has not yet been replicated in the slave and it returns an error that the user does not exist.

This is a pretty trivial example, but I can see how it can apply to a lot of cases. Is there a strategy for configuring replicated databases to help prevent this situation?

© Server Fault or respective owner

Related posts about database

Related posts about replication