Large-scale Internet project architecture goals
Traditional projects and Internet projects
Traditional projects : a company oa system, hr system, check-in system
Internet projects : Tmall, Baidu, jd
traditional items | internet project | |
---|---|---|
Use groups | corporate employees | All Internet users |
Concurrency | 1-thousands | million-billion |
Product Tolerance | high tolerance | almost zero tolerance |
safety | high security | Vulnerable |
Function | simple function | complex function |
renew | slow update | update fast |
From the comparison chart, it can be seen that Internet projects must:
High concurrency, fast response, good stability, good user experience
Measure website performance metrics
Response time : refers to the overall time it takes to execute a request from the beginning to receiving the response data at the end.
Concurrency : refers to the number of requests that the system can handle at the same time.
-
The number of concurrent connections : refers to the client initiates a request to the server and establishes a TCP connection. The total number of TCP connections to the server per second
-
Number of requests : also known as QPS (Query Per Second) refers to how many requests per second
-
Concurrent users : how many users per unit time
Throughput : refers to the number of requests that the system can handle per unit time.
High performance : Provide a fast access experience.
High availability : Website services can always be accessed normally.
Scalable : increase/decrease, increase/decrease processing power through hardware.
High scalability : low coupling between systems, easy to add/remove new functions/modules by adding/removing.
Security : Provide strategies such as website security access, data encryption, and secure storage.
cluster and distributed
Technologies required for large-scale Internet projects: cluster and distributed
cluster
Many "people" work together to do the same thing. For example, a restaurant needs to cut vegetables, prepare vegetables, wash dishes, and serve dishes; originally one chef was responsible for all the work, and later recruited new chefs, new chefs It is also doing all the work and sharing the pressure of the original chef. The new chef and the original chef are clusters
distributed
Many "people" do different things together. These different things add up to one big thing. The original chef is no longer responsible for cutting vegetables, washing dishes, and serving dishes, but recruits three people to be responsible respectively, so that each person can only concentrate on doing one thing, and the efficiency will be very high
Cluster + distributed (scalable)
If the restaurant has many orders, then we can recruit two chef teams and divide the orders into two parts. The two chef teams are equivalent to clusters, and each team cooks in a distributed manner. This kind of adding teams Scalability is achieved in a way
Architecture Development History
monolithic architecture
Put all the modules of a program into one server, and a multi-machine single architecture can be realized by forming a cluster of polymorphic servers
Advantages: convenient development and deployment, suitable for small projects
shortcoming:
- Slow project start
- Poor reliability: a module breaks and the whole project breaks
- poor scalability
- poor scalability
- low performance
vertical architecture
Vertical architecture refers to the splitting of multiple modules in a monolithic architecture into multiple independent projects. Form multiple independent monolithic architectures.
Compared with the monolithic architecture, it is basically optimized, but the vertical architecture also has its own shortcomings:
Each app does not interact with each other, such as the login page, personal information page, etc. The functions required by each module need to be added to each app, resulting in more repetitive functions
distributed architecture
On the basis of the vertical architecture, the repeated modules are extracted to form an independent module and become a service provider
RPC: the way consumers call service providers
Disadvantages of distributed architecture:
Once the service provider changes, all consumers need to change
SOA architecture
Consumers and providers do not communicate directly, but interact with each other through the service bus
ESB: Enterprise Service Bus, Service Broker. It mainly provides a service for interaction between services. ESB includes functions such as: load balancing, flow control, encryption processing, service monitoring, exception handling, emergency monitoring and so on.
microservice architecture
The microservice architecture is the sublimation of SOA. One of the key points emphasized by the microservice architecture is that "business needs to be thoroughly componentized and serviced". The original single business system will be split into multiple small application. These small applications complete interaction and integration through services.
Dubbo is a product of the SOA era, and SpringCloud is a product of the microservice era