Home >
Back-end > What must the business scenario with a distributed lock?
What must the business scenario with a distributed lock?
Recently there is a doubt very bother me, I will do a distributed lock, redis, zk and so on, but I just want to ask next what scene insist on using a distributed lock, online always take what inventory oversold, for example, but clearly the update inside add a where clause for the where inventory & gt; Purchase quantity can solve things why use lock, assemble made can also guarantee the serial asynchronous queue run, and what to say to address business layer idempotence; Solve the MQ consumers accept the same message many times; Multiple machines perform regular tasks at the same time, etc., these are not to do it with a distributed lock, a lot of solutions, yao said high concurrency, not more should avoid using the lock? Please bosses to solve the doubts, the abnormal behaviour