How to deal with race conditions in the RESTful app?

Here is what happens in my RESTful web application:

  • HTTP request comes
  • The application begins to build a response with some initial piece of data
  • Other queries modify the data used in step 2
  • The first request understands that the data has expired.

What to do? Failed to execute the request and return an error to the client? Or should it start from scratch (takes more time than the client expects)?

+5
source share
5 answers

Assuming that this is not about db transactions, they say that distributed, lengthy processes are involved at every step.

(- 409/410 http-) , , . , .

, / , , , , .

+1

IMHO REST , :

  • , .
  • /

- , - .

+4

, , , :
" , , . , , , ".
. , . , .
, , . , , ?
, .
"" , , .

+1

, , - . . , :

, , .

-1

All Articles