Hello guys, i have one interesting question. If i have 3 instances of my application with load balancer, can be the situation when 2 instance edit some info in the database at the same time? (Race condition as i remember correctly). Anybody know about this something?
But if we write code correctly, we will not have race condition with one application instance. But if we have 2 or more app instance that connect to 1 database, we have a risk with this. Did you have this problem when using several app instance?
Yes, just as you said here, which I thought was what you're trying to resolve? Locking the table resolves that.
when 2 instance edit some info in the database at the same time
But whether it's 500 app servers behind a load balancer all using a common database, or a single server using a single database, the problem is the same. The problem is "2 or more requests to edit the same record in the same database at the same time." Where the requests actually come from don't matter. It could be multiple servers, or the same server.