About the database load from the query of more than 12306 votes

Source: Internet
Author: User


At the beginning, I never understood why 12306 of the many functions should be separated. For example, the query function of 12306 of the remaining tickets is separated from the ticket purchasing function. In fact, I should consider it with a general thinking, I can click to purchase a ticket to tell me how many remaining tickets are there. You can also integrate fare query into the above two functions.

But why are these functions separated? I personally think there is a reason. We know that purchasing a ticket is actually a read/write operation on the read database, while querying the remaining ticket and fare is actually a read operation on the database. Here we can clearly understand that the cost of reading and writing is completely different for the database.

In this case, the best way is to improve the performance of single-point databases and adopt distributed systems. However, both single-point databases and distributed systems cannot bear the pressure of China as a whole. A good way is to use distributed functions.

The 12306 most likely practice is to adopt a distributed database, and not every single point has the same read/write function, because it is very difficult to ensure Database Consistency in such a centralized access. A good solution is to use an image, a readable and writable server, and the rest are read-only servers. That is to say, the query function is transferred to the read-only server to reduce the access pressure on the server. This transfers pressure to other servers to a considerable extent. That is, the master and slave concepts in MySQL.

12306 is undoubtedly a concentrated problem of big data distribution. There are still many problems to be studied.


This article from IT blog, reprint please note, http://www.itbuluoge.com ,~ Sharing of programming, algorithms, and database technologies

Related Article

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.