1. You can find out how much money you can get for each order first. Note: you can"t inquire about it when you place an order. (the current consideration is to slow down the memory when querying, but if this order is checked, the order will not necessarily be placed, and the cache time is not easy to determine)
2. The money deduction is deducted when this order is accepted
3. If multithreaded or looped over a pile of orders, how to ensure that the account balance is greater than 0? The existence of the balance DB, the operation of the balance has been ensured through the reids that the balance update is safe.
the title is like the above, welcome to give us your advice!