Answer the question
In order to leave comments, you need to log in
Node.JS Express. Simultaneous requests, an opinion is required. How to be?
I describe my problem that haunts me.
In general, I make 2 POST requests with the same data at the same time.
The server logic is such that the data in the request is unique. As a result, when sending two requests, no error occurs - this is not normal behavior, in my opinion, since both requests were successfully completed. Next, I did a sleep for 10 milliseconds, and everything began to work fine.
My concern is, is it possible to send n-th number of simultaneous requests from different users and how to prevent the same data from getting into the database?
Answer the question
In order to leave comments, you need to log in
Физически не возможно принять два и более запроса одновременно.
Физически не возможно в одном инстансе ноды одновременно их принять из сокета.
Как правильно написали - в очередь, или базу точить (фактически база будет очередью).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question