In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Large-scale website architecture is a series of documents, welcome your attention. This sharing theme: e-commerce website architecture case. From the demand of e-commerce website to the stand-alone architecture, it has gradually evolved into a commonly used prototype of distributed architecture for reference. In addition to functional requirements, it also has certain non-functional quality requirements (architecture objectives), such as high performance, high availability, scalability, scalability and so on.
According to the actual needs, it is no problem to transform, expand and support tens of millions of PV.
This sharing outline
The causes of e-commerce cases
E-commerce website demand
Primary structure of the website
System capacity estimation
Analysis of website structure
Optimization of website architecture
Architecture summary
E-commerce website case, there are a total of three articles this article mainly describes the requirements of the website, the initial structure of the site, the system capacity estimation method.
I. the reasons for the cases of e-commerce
At present, there are mainly several types of distributed large-scale websites. Large portals, such as NetEase, Sina, etc.; 2.SNS sites, such as Campus, Kaixin, etc. E-commerce sites: such as Alibaba, JD.com Mall, Gome online, Automobile House, etc. Large portals are generally news information, which can be optimized by CDN, static and other methods. Kaixin is more interactive, which may introduce more NOSQL, distributed cache, use high-performance communication framework and so on. E-commerce website has the above two kinds of characteristics, such as product details can use CDN, static, interactive need to use NOSQL and other technologies. Therefore, we use the e-commerce website as a case for analysis.
By the way, I would like to recommend a Java technology exchange group: 908676731, which will share some videos recorded by senior architects: Spring,MyBatis,Netty source code analysis, the principles of high concurrency, high performance, distributed, micro-service architecture, JVM performance optimization, distributed architecture, and so on. You can also get free learning resources and benefit a lot at present!
Second, the demand for e-commerce websites
Customer requirements:
Set up a full-category e-commerce website (B2C), where users can buy goods online, pay online or pay on delivery.
Users can communicate with customer service online when purchasing.
After users receive the goods, they can rate and evaluate the goods.
At present, there is a mature purchase, sale and storage system; it needs to be connected with the website.
Hope to be able to support the development of business for 3 ~ 5 years.
The number of users is expected to reach 10 million in 3 ~ 5 years.
Regularly hold double 11, double 12, Women's Day and other activities.
Other functions refer to websites such as JD.com or Gome online.
The customer is the customer, will not tell you what you want, will only tell you what he wants, we often have to guide, tap the needs of customers. Fortunately, a clear reference website is provided. Therefore, the next step is to do a lot of analysis, combined with the industry, as well as reference websites to provide solutions to customers.
Others are slightly ~
Demand function matrix
The traditional practice of requirements management uses use case diagrams or module diagrams (requirements list) to describe requirements. This often ignores a very important requirement (non-functional requirement), so it is recommended that you use the requirement function matrix to describe the requirements.
The demand matrix of this e-commerce website is as follows:
Website demand
Functional requirements
Non-functional requirements
Full range of e-commerce websites
Classified management, commodity management
Facilitate multi-category management (flexibility)
Website access speed should be fast (high performance)
Requirements for picture storage (a large number of small pictures)
Users can buy goods online
Member management, shopping cart, settlement function
Good shopping experience (availability, performance)
Online payment or cash on delivery
Multiple online payment methods
Payment process should be secure, data encryption (security)
Flexible switching of multiple payment interfaces (flexibility, expansibility)
Can communicate with customer service online
Online customer service function
Reliability: instant messaging
Commodity scoring and evaluation
Commodity review
At present, there is a mature purchase, sale and storage system.
Docking purchase, sale and storage
Belong to constraint condition
Data consistency and robustness should be considered when docking.
Support business development for 3 ~ 5 years
Belong to constraint condition
Scalability
The number of users reached 10 million in 3 ~ 5 years.
Constraint condition
Hold double 11, double 12, Women's Day and other activities
Activity management, second kill
Sudden increase in access traffic (scalable)
Real-time requirements (high performance)
Refer to JD.com or Gome online
Reference condition
The above is a simple example of e-commerce website requirements, the purpose is to show that (1) when requirements analysis, large-scale distributed systems focus on non-functional requirements; (2) describe a simple e-commerce demand scenario, so that we have a basis for the next step of analysis and design.
Third, the primary structure of the website
The general website, at the beginning of the practice, is three servers, one deployment application, one deployment database, one deployment NFS file system.
This is a more traditional practice a few years ago, before seeing a website with more than 100000 members, vertical clothing design portal, N multi-pictures. A server is used to deploy applications, databases and image storage. There are a lot of performance problems.
As shown below:
However, the current mainstream website architecture has undergone earth-shaking changes. Generally speaking, clusters are used to carry out highly available designs. At least it looks like this.
(1) use clusters to redundant application servers to achieve high availability; (load balancer devices can be deployed with applications)
Use database active / standby mode to achieve data backup and high availability
IV. System capacity estimation
Estimate steps:
(1) number of registered users-average daily UV-daily PV-daily concurrency
(2) Peak estimate: 2-3 times the normal value.
(3) the storage capacity calculates the system capacity according to the concurrency (concurrency, number of transactions).
Customer requirements: the number of users has reached 10 million registered users in 3 ~ 5 years.
Estimates of concurrency per second:
(1) the daily UV is 2 million (2008 principle)
(2) Click and browse 30 times a day.
(3) quantity of PV: 2000.30 = 60 million
(4) centralized traffic: there will be 60 million * 0.8 = 48 million (28 principles) in 24 hours, 0.2 hours and 4.8 hours.
(5) concurrent output per minute: 4.8pm 60min 288min, visit 4800pm 288 = 167000 (approximately equal to)
(6) concurrency per second: 167000 / 60 / 2780 (approximately equal to)
(7) assuming that the peak period is three times the normal value, the number of concurrency per second can reach 8340.
(8) 1 millisecond = 1.3 visits
Do you regret not studying math well?! (I don't know if there is any mistake in the above calculation, hehe)
Server estimate: (take tomcat server as an example)
(1) according to one web server, 300 concurrent calculations per second are supported. Usually requires 10 servers (approximately equal to); [tomcat default configuration is 150]
(2) Peak period: 30 servers are required
Capacity estimate: 70ppm 90 principle
The system CPU is generally maintained at the level of about 70%, and the peak reaches the level of 90%. It is not a waste of resources and is relatively stable. Memory, similar to IO.
The above estimates are for reference only, because server configuration, business logic complexity and so on have an impact. CPU, hard disk, network, etc., are no longer evaluated.
By the way, I would like to recommend a Java technology exchange group: 908676731, which will share some videos recorded by senior architects: Spring,MyBatis,Netty source code analysis, the principles of high concurrency, high performance, distributed, micro-service architecture, JVM performance optimization, distributed architecture, and so on. You can also get free learning resources and benefit a lot at present!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.