Brief analysis on the system design of the website snapping up second kill

Source: Internet
Author: User

Second-kill is a common marketing means of e-commerce websites.

Principle

    • Do not shut down the entire system.
    • Do not display the error data even if the system fails.
    • Try to remain fair and impartial.

Achieve results

    • Before the start of the second kill, the snapping button is not started for the activity.
    • When the second kill starts, the snapping button can click on the order.
    • After the second Kill, the button button becomes the second kill has ended.

Technical research

    • The impact of a short period of large traffic on the existing website business.

      The second kill is a website marketing an additional activity, the time is short, the concurrency quantity is big.

      If the site and the original application of the deployment together, will inevitably impact on the existing business, a slight carelessness may lead to the entire site paralysis.

    • Under high concurrency, the load pressure on the server database is enormous.

      Users will not miss the second kill activity by constantly refreshing the browser before the start of the second kill.

      Frequent access to programs and databases can cause load stress on application servers and database servers.

    • The problem of network bandwidth is many times more than usual.

      If the size of the second-kill page is 200K, if the maximum number of concurrent times is 10,000, then the network and server bandwidth required is 2G (200kx10000).

      These network bandwidth is due to the second kill activity new, more than the usual bandwidth used by the site.

    • Avoid direct orders.

      Seconds to kill the game rule is to the second kill to start the purchase of goods, before this point in time, can only browse information is not allowed to order.

      And the next single page is also a normal URL, if you get this URL, do not wait until the start of the second kill to order.

Coping strategies

    • Second-kill system standalone deployment

      In order to avoid the impact of the large traffic in the short time on the existing website business, the system can be deployed independently.

      If necessary, you can also use a separate domain name to completely isolate it from the Web site.

      Even if the second kill system crashes, it will not affect the site.

    • Seconds Kill product Page static

      The product description, parameters, details, all written to a static page, without the application of logical processing, no need to access the database.

      You do not have to deploy dynamic servers and database servers.

    • Network bandwidth for the lease of the second kill activity

      Because the second kill new network bandwidth, must and the operator re-purchase or lease bandwidth.

      In order to reduce the pressure on the server, you need to cache the Second product page in the CDN, the same CDN server also need to temporarily lease bandwidth.

    • Dynamically generate URLs for randomly-next-order pages

      In order to avoid direct user access to the order URL, the URL needs to be dynamic, using random numbers as parameters, only seconds to kill the beginning of the generation.

Architecture Design

    • How to control the seconds Kill product page Snapping button available/disabled.

      The Buy button can only be lit when the second kill starts, before it is grayed out, and the display activity does not start.

      If the page is dynamically generated, each time the refresh to request the server, it will inevitably cause load pressure on the service side.

      If the page is a static page, you can cache the page on a CDN, reverse proxy Server, or even on a user's browser.

      However, when the second kill starts, the user refreshes the page and does not request the application server at all.

      Solution:

      Using JS script control, reference a JS file in the page (the file is very small), but the file is not cached.

      The purpose of this JS is to include the start flag, modify the style, generate the next single page URL and random parameters.

      The JS file is not cached by the procedure: xxx.js?v= random number.

      There will be a server for monitoring (timed up and down):

      Pushes the file when the second kill activity starts.

      Push the file at the end of the second kill activity, mark the end flag, and modify the style.

      Such as.

A brief talk on system architecture design of second kill-1
    • How to only allow, the first submitted single entry order system.

      Since there is only one user who kills the product in seconds, it is necessary to place an order before placing a check.

      If an order has been submitted successfully, it indicates the end of the activity and enters the end of the second kill page.

      In fact, the order number can only have one, in order to reduce the load pressure of the next single page server, you can control the entry to the next page.

      Only a few users can enter the next page, and other users go directly to the end of the second kill page.

      (Pre-check logic) Check the number of order requests that have been processed by this machine:

      If more than 10, the end page is returned directly to the user.

      If no more than 10, the user can enter the fill in the Order and confirmation page.

      (Pre-check logic) checks the number of global submitted orders:

      More than seconds to kill the total number of items, return to the end of the second kill page.

      No more than seconds to kill the total number of items submitted to the sub-order system.

      Such as.

A brief talk on system architecture design of second kill-2
    • Reduction of inventory operations

      Take down inventory (user experience is good)

      Payment Reduction Inventory

The order is as simple as possible, the purchase data is 1 and cannot be edited, the shipping address and payment method is blank or the user defaults, allow the order to be modified after submission.



Gecko
Links: https://www.jianshu.com/p/cf82e1f44b2b
Source: Pinterest
The copyright of the book is owned by the author, and any form of reprint should be contacted by the author for authorization and attribution.

Brief analysis on the system design of the website snapping up second kill

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.