Architecture: Understanding the architecture model

Architecture Evolution has a lot of knowledge, on the whole can be attributed to the following pattern here that the model is essentially abstract architecture technical points. Highly recommended Li Zhihui teacher's "large-scale Web Site Technology Framework", the contents of this article is derived from it, on this basis to expand the next.

Each model describes the core of a solution to the problems around us and repeated occurrence of the problem. In this way, you can use the program again and again without having to do repetitive work.

The so-called site architecture model that in order to address the high concurrent access to large sites facing huge amounts of data, highly reliable operation of the lamp a series of problems and challenges. For this reason, in practice, we put forward a number of solutions to enable site performance, high reliability, easy scalable, extensible, security and other technical architecture goals.

Stratified

Layering is the most common enterprise application system of an architectural model, the system will cut in the transverse dimension is divided into several sections, each responsible for a portion of relatively simple and relatively simple functions, then through the upper layer of the lower layer composition and scheduling dependencies a complete system.

In the layered architecture of the site, it is common for the three layers, namely the application layer, service layer, data layer:

  • Specific business application layer responsible for displaying and views;
  • Services layer provides services to support the application layer;
  • Database provides data storage access services, such as databases, caching, file, search engines.

Layered architecture is logically, physically deployed, three-tier architecture can be deployed on the same physical machine, but with the development of site operations, the inevitable need to deploy separate modules have been layered, three-tier architecture that is deployed separately on a different server, is the site have more computing resources to cope with more and more users access.

Therefore, although the original purpose planning software layered architecture model is clear and logical structure to facilitate the development and maintenance, but in the development of the site, the hierarchical structure of the site development is critical to distributed high concurrency direction of support.

Separated

If the software is layered in sliced transversely aspect, the partition is to be segmented in the longitudinal direction software aspects.
The larger the site, the more complex functions, types of services and data processing of the more, these different functions and services separates, packaged into modular units high cohesion and low coupling, not only helps develop and maintain software also distributed easy to deploy different modules, improve concurrent processing capability and scalability features of the site.

Large sites separated by size may be small. For example, in the application layer, separating the different services, such as the shopping, forums, search, advertising separated into different applications, there are opposing team responsible for, deployed on different servers.

distributed

For large sites, layered and separated by a main purpose is to cut the module after separation to facilitate distributed deployment, will soon be deployed in different modules on different servers, the call to work together remotely. Distributed means you can use more computers complete the same work, the more computers, the more CPU, memory, storage resources, and the amount of concurrent access to data can be processed through the greater and thus can provide more users service.

In Web applications, the commonly used program has distributed about several.

  • Distributed applications and services: hierarchical and distributed applications and service modules deployed after separation, can improve site performance and concurrency, accelerate the development and release rate, reduce database resource consumption.
  • Distributed static resource: Web site of static resources such as JS, CSS, Logo pictures and other resources distributed deployment opposition and independent domain name, often referred to static and dynamic separation. Static resources distributed deployment can reduce the load pressure application server; by using a separate domain name to speed up the loading speed of the browser concurrently.
  • Distributed data storage: large sites need to process massive amounts of data to P as a unit, a single computer can not provide such a large storage space, these databases require distributed storage.
  • Distributed computing: the current site commonly used Hadoop and MapReduce distributed computing framework for such batch computing, which is characterized by mobile computing rather than moving data, the calculation program distributed to the location where the data is calculated in order to speed up the computation and distributed.

Clusters

For users accessing centralized modules need to deploy a separate server clusters, ie multiple servers deploy the same application constitutes a cluster, to provide services jointly through load balancing device.

Server clusters can provide the same services more concurrent support, so when there are more users to access, simply want to add a new machine in the cluster can be; Also can be achieved when one is a server fails, you can the request is transferred to the other servers in the cluster by the failover load balancing mechanism, so you can improve system availability.

Cache

Cache object is to reduce the computing servers return data directly to the user. In today's software design, the cache has been everywhere. Concrete realization CDN, reverse proxy, the local cache, distributed cache and so on.

There are two conditions for the use of caching: data access hotspots uneven, that certain frequently accessed data in the cache needs; data are available under certain period of time, but soon expire, whether in the data because of outdated and dirty reads, affect the accuracy of the data.

asynchronous

Using asynchronous transmission of messages between the service call is not synchronized, but the operation into a plurality of operational phases, between each phase asynchronous collaboration by the method of sharing data is performed.

Embodied within a single server is available through multi-threaded processing of the shared memory of the embodiment; may be used in a distributed system implemented by a distributed asynchronous message queue.

Asynchronous architecture is typical of the way producers and consumers, the two are not directly call exist.

redundancy

Site requires 7 × 24 hours of continuous running, you have to have the appropriate redundancy in case one can not access when shoot down the machine, and a cluster redundancy can be achieved through the deployment of high-availability services constitute at least two servers. In addition to regular database backups also need to implement hot and cold backup. Even deploy disaster recovery data centers worldwide.

automation

Specifically the publishing process automation, automated code management, automated testing, automated security testing, automated deployment, automated monitoring, automatic alarm, automatic failover, automatic failure recovery.

Safety

Site security architecture in many modes: for authentication by password and mobile phone check code; logon, transaction requires the network traffic is encrypted; in order to prevent misuse of resources bots, you need a verification code to identify; for common XSS attacks, SQL injection requires transcoding; spam filtering required.

Agility

Positive acceptance of the demand for change, respond quickly to business development needs.

Published 156 original articles · won praise 8 · views 20000 +

Guess you like

Origin blog.csdn.net/weixin_42590334/article/details/103630080