L
L
Lexxtor2015-09-21 21:37:37
Scalability
Lexxtor, 2015-09-21 21:37:37

What are common mistakes under high load and multithreading?

That is, when PHP code is executed on different servers or on one, but there are several threads:
architecture.phps.jpg
What errors can there be in the code?
I came up with this situation: one instance of the application started and made a SELECT from the database, then, based on the data received, did an UPDATE, but between SELECT and UPDATE, another instance of the application changed the data in the database so that the data from the SELECT became irrelevant and UPDATE violated the integrity of the database. To avoid this, it is necessary to use transactions in vulnerable places?
What other situations might happen? What should be taken into account?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andre la'Balm, 2015-09-22
@grumblik

Read what is Select for update
A wonderful design, but in my opinion not all BDs support

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question