An order operation to purchase goods.
To reduce user points at the same time, insert an order.
In the same library, you can add pessimistic locking to the points table to prevent concurrently generated data from being read multiple times.
Now that HTTP is used to request points service and order service, how to use locking? To prevent reducing the points into negative numbers
==================
The items are point services, points services, and order services. The database is also separate. The lock doesn't work
巴扎黑2017-05-25 15:10:18
You have to consider whether there will be concurrency problems. If there are concurrency problems, it is recommended to put queues + things for processing.