Large website Technical Architecture reading notes 1 large Web site architecture patterns

Source: Internet
Author: User
Tags message queue

Architecture, aka Software architecture, is an abstract description of the overall architecture and components of the software that guides the design of large software systems in all aspects.
In terms of what a pattern is, the word from architecture is defined as: "Each pattern describes a problem that recurs around us and the core of the solution to that problem. This way, you can use the program again and again without having to do repetitive work. " The key to the pattern is the repeatability of the pattern, the repeatability of the problem and the scenario, and the reproducible use of the solution.

For the current high-concurrency access, mass data processing, high-reliability operation and a series of problems, many large internet companies put forward a variety of system solutions. These excellent and reliable solutions have been re-used by other sites, creating patterns.


1 layering
Layering, this is well understood. The expression layer, application layer, and persistence layer often used in the Java EE. That's the logic. Of course, more finely, we can divide the performance layer into the view layer and the business logic layer, the former is responsible for the art, the latter by the engineer. and the application layer, I can also be subdivided into data interface layer and logic processing layer, the former do data conversion, the latter is the real logical processing and operation.


2 Partitioning
Segmentation and layering are just perpendicular. In the system, for example, the two functions of refund and shopping are separated and packaged into a module unit with high cohesion and low coupling.
Layering is horizontal, and segmentation is vertical division.


3 distributed
This slightly troublesome.
It is distributed that the different modules that are layered and segmented are deployed on different servers, and the remote tune is used to work together.
The advantage of distribution is that the whole system can have more hardware/software resources to provide services externally, and the amount of concurrency that can be addressed will increase.
The disadvantage is that the calls between the 1 modules pass through the network, which can degrade performance.
2 because the entire system is split across multiple servers, the likelihood of downtime within the system increases, and once an outage occurs, it affects the application.
3 Data consistency is not easy to grasp
4 Maintenance More trouble
In a word, it depends on the situation, not distributed for distribution.
There are several specific strategies for distribution:
1 Distributed Applications and services
Please refer to my understanding of the Java Distributed System
It's a good writing article.

Just look at Figure 1, which is the invocation of each other between applications.


For an application in a distributed system, it often has three entries:
Remote Procedure call (other app to invoke my service),
Message Middleware (I subscribe to messages from other systems, other systems will send me messages),
Web Access (Primary access page).
It has many exits: Remote procedure calls (services that call other applications), message middleware (I send messages to the messaging server for other applications to consume), access to distributed caches, access to distributed logs, access to databases, and dispatch tasks. With entrances and exits, the rest is the core of the application, including the core logic code and the auxiliary framework. For a distributed system, one thing is essential, that is, the configuration center. Whether remote procedure calls, message middleware, or distributed caches, they all need to get an address list from the configuration center.
Excuse me: What is the difference between a remote procedure call and a message middleware?
Remote invocation refers to a method in which another module calls directly into the application. (Please refer to Dubbo frame)
The message middleware, which means I received messages from other apps, I do something based on the message. (Please refer to ACTIVITYMQ or ROCKETMQ)
2 Distributed static resources
To put it bluntly is to js,css, pictures and other static resources deployed independently, and take a separate domain name.
This reduces the pressure on the application server and can also speed up browser concurrent downloads because of the independent domain name.
For questions about browser concurrent Download resources, please refer to the
The number of concurrent fetch (load) resources for the same domain name by different browsers is limited
3 Distributed data and storage
I don't understand this, I'll say it later.
4 Distributed Computing
Should be a complex operation process, disassembled into n small process, and then use N server processing, and finally the structure of the summary.
4 clusters
A cluster is one that has multiple components to do the same thing.
The simplest, a tomcat no, I will come 10. Of course, externally, we have to provide a load balancing device, for the external, there is only one application system.




5 Cache
1 CDN
The full name of the CDN is the Content Delivery network, which is the contents distribution networks. To put it bluntly is to place static resources (or less-varied resources) on servers that are closer to the user's physical distance, and if there is data, there is no need to go backwards.
2 Reverse Proxy
This is also the cached data, but it is different from the CDN, CDN in the Network Service room, and the reverse proxy is part of the site front-end architecture, if there is data, there is no access to the application server.
3 Local Cache
The local cache is mostly stored in memory, and if there is data, there is no access to the database.
4 Distributed Cache
If the local cache (that is, memory) is not enough, the distributed cache is used.
There are two prerequisites for using a cache
1 Some data must be accessed frequently

2 data is valid for a certain period of time and will not expire immediately.


6 Async
In front of the said hierarchy, separation, distribution, multiple modules of mutual invocation is not directly called. Instead, it's asynchronous. That is, before, a calls B, only after B executes, a will do other things. And the asynchronous case is, a call B, to be precise, a to publish a message, B saw it go to execute, in the process of B execution, A has gone to do other things.
In a stand-alone environment, the call "message" between multiple modules is saved in the memory message queue.
In a distributed situation, multiple modules are asynchronously implemented through distributed Message Queuing.
The asynchronous architecture is a typical producer-consumer model.
There are several benefits of Asynchrony
1 The caller and the callee are decoupled, as long as the data structure layout, two modules can be arbitrarily changed inside, without fear of affecting each other.
2 Improve the usability of the system. If consumers are down, producers will continue to post messages, and the system is still available externally. Wait for the consumer to recover, and then continue to deal with the message.
3 Speed up website response.

4 Eliminate concurrency spikes.


7 Redundancy
Multiple application servers, one outage, the other can be used

More than one database server (or database), a power outage, earthquakes, tsunamis and other things to use.


8 Automation
Release process automation: Automated code Management, automated testing, automated security detection, automated deployment
The Web site may encounter various problems during its operation: server outages, program bugs, insufficient storage space, and sudden bursts of access spikes.
Automated monitoring, automated alarms, automated failover, automated failure recovery, automated degradation, automated resource allocation

I don't understand it at all. or understand, do not know how to achieve automation


9 Safe
Identity authentication via password and mobile check code
Network communication encryption (login, transaction, etc.)
Storage sensitive Data encryption processing
Website Verification Code
Common attack handling: XSS attacks, SQL injection
Spam, sensitive information filtering
Risk control (important operations such as transaction transfers)

Large website Technical Architecture reading notes 1 large Web site architecture patterns

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.