?
I. Architectural elements of a large web site
1. Performance (reflecting performance of multiple aspects of response time, TPS, System performance calculator, etc.) )
2. Availability
3. Scalability (for application servers, all servers are equivalent and stateless as long as the data is not saved on the server.) relational database, implemented by means of routing partitioning, etc.)
4. Extensibility
5. Security
?
Second, performance-response time determines the user
( 1 ) Browser side:
① browser cache;
② using page compression;
?? PS : Gzip the compression efficiency is very high and can usually be achieved 70% the compression rate, that is, if your page has 30K , and after compression it becomes a 9K around. To enable Gzip compression to improve browsing speed, you can browse this article:http://www.chinaz.com/web/2012/1017/278682.shtml
③ reasonable layout page;
CSS : Place the style sheet at the top ; Avoid css expression ( Expression_r ) ; using external javascript css javascript css <LINK> instead of @import
javascript : Place the script at the bottom of the page ; use external javascript and css ; cut javascript and eliminate duplicate scripts, reduce DOM access ; Develop intelligent event handlers;
④ decrease Span style= "Font-family:verdana" >cookie transmission;
( 2 ) CDN : Content distribution Network ( Content Delivery Network , Short CDN It distributes the accelerated content to the node closest to the user, shortens the delay of the user viewing the object, improves the response speed of the user to the website and the usability of the website, solves the problem that the network bandwidth is small, the user accesses is large, and the dot distribution is not equal. For details, please see Baidu Encyclopedia:Http://baike.baidu.com/view/8689800.htm?from_id=420951&type=search&fromtitle=CDN &fr=aladdin
( 3 ) Application Server-side: Server local cache and distributed cache;
Memcached Introduction: http://baike.baidu.com/view/794242.htm
Redis Introduction: http://baike.baidu.com/view/4595959.htm
( 4 ) Server cluster technology: Web server clusters, database server clusters, distributed cache server clusters, and so on, through the deployment of multiple servers to provide similar services to the external, improve the overall processing capacity.
( 5 ) database server side:
① Index: Index ( Index ) is one or more columns in the database table (for example, Employee Last name of the table (name) column) To sort the structure of the values. If you want to find him or her by the name of a particular employee, the index helps you get information faster than searching all the rows in the table.
? PS : It is important to note that too many indexes will affect the speed of updates and insertions because it requires the same update for each index file.
② cache: The database cache is between the application and the physical data source, and it is designed to reduce the frequency of application access to the database's physical data source, thus improving the performance of the application.
③ SQL optimization: When a database-based application is running slowly, 90% may be due to a problem with the data-access program, either without optimization, or without the best way to write code, so you need to review and optimize your data access / handler. Specifically, you can browse this article:http://www.cnblogs.com/Shaina/archive/2012/04/22/2464576.html
④ NoSQL : the Ascendant NoSQL by optimizing data model, storage structure, scalability and so on, the advantages of database in performance are becoming more and more obvious.
Iii. availability-Can you guarantee a few 9?
( 1 How can i measure availability? Backed by 9 : Almost all sites promise to be available for the hour, but in fact they are not fully realized and there are always some downtime. Then, removing these downtime is the total available time for the site. The usability metrics of the site to measure the usability of the site, such as the availability of some well-known sites to 99.99%.
( 2 What are the means of improving usability?
① Core: redundancy - Each server backup to ensure the overall availability;
② Application Server-side: Cluster with load balancing devices, where one outage immediately switches to another server to continue serving, guaranteeing high availability.
③ Storage Server-side: Requires real-time backup of data, when one outage immediately translates data access requests to other servers and recovers data to ensure high data availability.
Iv. flexibility-Flexible to be a man
( 1 ) Measurement criteria:
① can I build a cluster on a polymorphic server?
② is it easy to add new servers to the cluster?
③ can I provide a non-discriminatory service after joining the server?
( 2 ) Main means:
① Application Server: Using the appropriate load balancing device (hardware or software?) F5 or lvs+keepalived);
② Cache server: Improved cache routing algorithm to ensure the accessibility of cached data;
③ database server: A cluster of multiple servers is formed by means of routing differentiation;
V. Extensibility-the new business is on the line
( 1 metrics: Is it possible to increase the number of new businesses without impacting the transparency of existing products (does it need to be modified to match existing business?) );
( 2 ) Main means:
① Event-Driven architecture: Using message Queue implementation;
② Distributed services: separating business and reusable services;
VI. Safety-Mom doesn't have to worry about my photos anymore.
( 1 What is security? Protect the site from malicious access and attacks, protect the site's important data is not stolen;
( 2 measurement criteria: whether there is a credible response strategy for existing and potential attack spy means;
?
Reprinted from:http://www.cnblogs.com/edisonchou/
Reading notes 3 architectural elements of a large web site