Design guidelines for Web distributed systems
The following is an example of uploading and querying images to illustrate the design considerations of distributed Web architectures and commonly used methods to improve performance. This example provides two simple functions for uploading images and downloading images, and has a hypothetical condition? :
-Can store an unlimited number of images, that is, storage needs scalability
-Download image to provide low bandwidth delay, i.e. fast speed
-If a customer uploads a picture, the picture will be permanently saved in the database unless the customer deletes it. i.e. Reliability
-Easy to maintain system
-The entire system cannot be too expensive.
first of all, This example system refers to the following basic requirements of web system design, its simplest design logical structure such as.
-Availability availability, which ensures that the site is available every time.
-performance performance, i.e. the user responds quickly.
-Reliability reliability, that is, reliable results, two times the same requests get the same results, and data consistency.
-Scalability scalability, that is, the system is easy to scale when the load is increased.
-Manageability manageability, that is, the system can be easily managed.
-Cost. The cost of the system is reliable.
Services
Block the functions of different modules, easy to manage and improve the system performance (for example, the Apache default connection number is 500, if upload and download on a server, will cause performance problems), block after the structure of the diagram:
Redundant design
In order to ensure the stability of the system, and critical modules in the event of a rapid recovery, must use redundancy technology, the use of redundant basic structure such as:
chunked Storage
If the data is too large, the single server will not be able to store all of the data, and all of the data is saved in one server, which degrades the performance of data retrieval. Extensions can be divided into vertical stand-alone extensions and horizontally increase server extensions. The industry now prefers the latter. The basic structure of the review extension after data chunking is:
In the Web system architecture, the most challenge problem is the data read and storage section, the application request processing part can be solved by load balancing and horizontal scaling, the following system simplification, focus on technology, simplified system structure can be simply understood as:
---------"
Generally reading data is more frequent than writing data, but writing data to disk, more time than reading data, and then read and write two aspects of aspects of architecture design skills, imagine the following scenario:
If this design, finding the data you want is no doubt a needle in the haystack, in order to improve the search and read data performance, we generally use the following technologies:
Cache (Memcached,)
Agent (Squid and Varnish)
Index
Load Balance
Write-based techniques for high performance can take the asynchronous queue mechanism (RabbitMQ, ActiveMQ, beanstalkd, Zookeeper, Redis).
An example analysis of distributed extensible Web Architecture Design