This is my long time confusion. If multiple process are writing the same records into the same database table simultaneously, would they have conflict?
A similar question, for example, one master machine keeps distributing requests to many other machines, say, to insert one record into table on machine-A. Somehow this operation is very slow on machine-A and the master controller will re-send the exactly same request to machine-B. Then what will happen? There'll be conflict?
There are actually two questions, but I'll try to answer the main one.
First of all, what kind of databases are we talking about? If it's a modern RDBMS like Oracle, PostgreSQL, MSSQL, etc., then most likely it has lock-by-row mechanism, which means that each process can insert/update/delete rows simultaneously as long as they do not intersect each other.
Once it happens that two processes are trying to update the same row, one process (which was lucky to be first) will update the row, whereas the second process will have to wait until the first process commits or rollbacks its transaction. This updated row is now locked for any change by any process, but the first one.
The same thing happens if the first process deletes a row. No other process can insert a new row with the same unique key until the first one commits or rollbacks transaction.
Now it gets more interesting when we come to two processes inserting rows with the same unique key, which, if let them both complete, will break the relational model. There are no rows in a table yet, so nothing to lock. But, there's an index somewhere that provides uniqueness. So instead of locking rows the processes will actually try to lock the index's bucket. And the process that was first will succeed. Now, when the second process tries to insert a row, it'll will see that the bucket is locked. Like in the first cases, the second process will have to wait until the bucket is released, and then check if insert is possible and lock the bucket for itself.
This is actually a very superficial and general explanation, but it gives an idea of how conflicts resolution mechanism works. Actual implementations may differ from database to database and be much more complex.