Database state between multiple applications
<p>I have a game server that uses a SQL database to store/retrieve player data. The game server has a queue of pending database requests/queries to avoid blocking the network thread poll. If there's too many players playing, the database gets stressed and begins slowing down queries. </p>

<p>If I have multiple servers running, my fear is that one player could disconnect, and before its information gets saved to the database, the same player connects to another game server (multiple rooms) and gets the old information loaded (making him lose progress in the game). </p>

<p>I was wondering if there's any way to manage this type of synchronization between multiple application instances (game servers).</p>

<p>I thought about transactions, but that can still cause problems if the queue isn't getting dequeued fast enough (queries pending on the server memory - not on database server).</p>

<p>Making a "database server" in which all gameservers connects and requests database operations (thus avoiding multiple queues) is <strong>not an option</strong>. </p>

<p>Assume that database is perfectly optimized and the solutions must be made on the application itself.</p>

<p>What are my options here?</p>