In the php marketplace, frozen goods and coupons are suitable for triggering the thawing program?

Source: Internet
Author: User
Tags field table
For example, php mall now uses the method for users to freeze the goods they place after placing an order. The frozen time is 15 minutes. The question now is how to unfreeze the goods that have expired and unpaid orders. I can write a thawing program, but the question is, when will this program be triggered? Because this unfreeze program must be locked...
Now I am using this method. After placing an order, the user will freeze the goods ordered for 15 minutes. Now the question is how to unfreeze the expired and unpaid goods.
I can write a thawing program, but the question is, when will this program be triggered? Because this unfreeze program must lock the Table query, will it cause a huge database burden if any place with inventory is triggered?

Reply content:

Example: php mall
Now I am using this method. After placing an order, the user will freeze the goods ordered for 15 minutes. Now the question is how to unfreeze the expired and unpaid goods.
I can write a thawing program, but the question is, when will this program be triggered? Because this unfreeze program must lock the Table query, will it cause a huge database burden if any place with inventory is triggered?

1: The operation time can be used to determine whether there is a product to be restored when the user visits a specific product page; it can also be used to determine whether the order is valid for 15 minutes and whether there is an order to be restored for the product corresponding to the order, and whether the expiration time is appropriate in combination with memcache.
2: scheduled tasks (usually executed when there is a small amount of traffic), but certainly not any inventory of goods/places, should be purchased by someone.
3: If you need to restore too much data, you can consider using redis. The key is the order ID, and the value is the expiration time. You can regularly run the order here.

Waiting for a master ~

Try to add a field table that the product has been frozen and the time for saving and unfreezing the table. You must take this field into account during operations. This should be fine...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.