Preventing double HTTP POST

前端 未结 11 799
死守一世寂寞
死守一世寂寞 2020-12-29 05:23

I have made a little app for signing up for an event. User input their data and click \"sign me in\".

Now sometimes people are double in the database, the exact sam

11条回答
  •  感情败类
    2020-12-29 06:01

    None of the solutions address a load-balance server.

    If you have some load balancer, send a UUID (or any type of unique number) to the server to store and read again will not work well if the server is not aware of other servers, because each request could be processed by a different server in a stateless environment. These servers need to read/write to the same place.

    If you have multiple servers you will need to have some shared cache (like a Redis) among the servers to read/write the unique value in the same place (what could be an over-engineering solution, but works).

提交回复
热议问题