How to ensure that two or more simultaneous requests to a MySQL table don't interfere Suppose I have about a 1000 simultaneous requests to a table in my DB which consists of these statements (in order):
SELECT

INSERT or UPDATE (could be multiple)

DELETE

and I want to make sure that none of the requests interfere with one another and the table is in an updated state for the next incoming request. For example:
Request #1 comes in.

Request #2 comes in.

Request #1 starts to get processed.

Request #2 should start only when Request #1 is processed so that the data view is consistent and updated for the next request.

I searched for this situation around the web and found out two things that could be of help:

Transactions

Table Locking


But when I read about Transactions, I found out that while a row is being processed by a transaction, other transactions can still come along and modify that row which defeats my purpose.
Also in case of locking, a column can only be locked in one mode i.e. either in READ or WRITE mode, which again fails to keep the data consistent as while reading a row it may get updated and the data which was just read would become an older version of what the table actually is right now.
Is there a solid way to achieve this which can make sure that no request interferes with another and the table is in an updated state for the next incoming request?
I am using MySQL with PHP if this helps.
Transactions are the way to go.

... I found out that while a row is being processed by a transaction, other transactions can still come along and modify that row ...

Cite your source because, frankly, it's just plain wrong.
The whole point of Transactions is that they give you exactly the kind of &quot;atomicity&quot; of change that you're looking for.
Table locking is far too broad a brush to use here.
Locking many rows just update one is not efficient, creates more contention, more waiting and just slows everything down.  To draw a parallel, it would be like trying to deliver a letter to one house by blocking up every letterbox on every other house in the city.