Home >
Article > php教程 > redis optimistic lock practice flash sale
redis optimistic lock practice flash sale
高洛峰Original
2016-11-22 17:51:112537browse
Demand: There is a bid (it can be understood as grabbing red envelopes, the accountBalance is pre-assigned 1,000 yuan), and everyone can snap up it. After each user succeeds in snapping up, the total number of the last bid will be updated. In the case of concurrency, redis's optimistic lock is used to ensure updates. To check the correctness of the total bid value, first put a bid amount into redis:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn