Queue accomplished by redis
Plus a queuing queue and buy inventory results queue and queue. High concurrency, the user will enter the queue queues, with a thread loop processing line taken from a user queue, the user determines whether the result queue in buying, if, they have been snapped, or not to buy, stock minus 1, write to the database, the result queue into user.