Opening restaurants and doing software--how to improve the performance of large Web sites

Source: Internet
Author: User

Opening a restaurant and doing software

When I was at school, I had the urge to open a restaurant, and bought a very thick book, called "How to open a restaurant." Later made the software, the recent renovation of the house this impulse came again, rummaging through to find this book looked at but think this is a teach how to do a large web site a rare martial arts tips.

A meal tube from small to big can be divided into the following steps, the restaurant in the larger and more customers can accommodate more and more, the efficiency of the meal tube more and more quickly.

First of all, starting a restaurant from scratch is naturally not rich and cannot afford a big storefront, when the kitchen and restaurant are crammed into a room, a chef and a man. Our first idea was to expand the store to move the kitchen out of the way and hire another man, because we had a unique taste that attracted a large number of customers and the customer had to wait in line at the peak. That is, our first step into the performance of the site-the application and database separation, the site's application (the equivalent of restaurants and buddies) and the database (equivalent to kitchen and chef) deployed separately in different servers, to avoid the contention of hardware resources.

This time the store expands, the customer does not have to wait in line waiting, all can enter the dining room. The expansion of the kitchen and restaurant area allows the chef and the man to take the usual tools out of the cupboard and put them on the obvious, ready to be used, so that the efficiency of the work is significantly improved. That is, we enter the second step of the performance of the site-data caching (including page, page fragment cache), the common data from the database, put in memory, improve access speed, reduce database connection.

Efficiency has improved, Word-of-mouth is also better, more and more natural customers. Because we have a limited staff, so many customer needs (such as ordering, paying, etc.) have to wait for some time, so we decided to increase the chef and the man to deal with more customer requests. That's the third step in the performance improvement of our website-horizontally extending the application server and database server (that is, database cluster or sub-Library). By increasing application servers and database servers, sharing more applications and data requests, load Balancing tool support is required to distribute access evenly across multiple application servers.

With the further increase of customers, a very real problem arises, in order to deal with more customers we have purchased a large number of tableware and other essential items, originally because the number of these items are made by the chef and the man at random access, goods storage is very confusing, due to limited space everyone into and out also very crowded, As a result, the use of these items took up a lot of time, and eventually we decided to classify them further and store them separately, with the person responsible for accessing the items, adding new windows and storing and taking them in different windows. That is, our fourth step to improve the performance of the website----the establishment of data access layer (DAL) and data read and write separation, general MySQL, the fastest storage engine MyISAM, it is based on table locking, that is, if a lock, then the entire data file outside the access, must wait until the previous operation is completed, In order to receive the next operation, so we can further decompose the larger data table, that is, by way of the table, reduce congestion to improve the efficiency of database access, the table caused some applications have to consider the table rules, the database access program complexity increased, These table rules can be uniformly processed by establishing a unified data access Layer (DAL). Using data read/write separation technology, the data read and written in different database server, which requires a program-level synchronization program support, but also to the aforementioned Dal layer to transform.

As a restaurant is large enough to become a catering group, the original small restaurant management method obviously does not work, at this time we need to divide according to function, such as the establishment of independent financial department, for the simple application of such an independent department may rather reduce the efficiency, However, for the complex application of this division is necessary for both efficiency and stability, that is, we enter the Web site performance improvement of the fifth step-large distributed applications. In fact, the essence of architecture is layering, but a clear demand after layering is a highly efficient and stable communication framework, and how this architecture is designed is a problem we face.

This article is inspired by the "programmer" November 2008 issue of the "large-scale Web site architecture and Knowledge system" article, the method proposed in this paper also stems from this article, this article also proposed the implementation of these methods, interested friends can look.

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.