In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the relevant knowledge of "what technologies java architects must master". The editor shows you the operation process through actual cases, the operation method is simple and fast, and it is practical. I hope this article "what technologies java architects must master" can help you solve the problem.
I. Preface
The system architecture of a mature large website (such as Taobao, JD.com, etc.) does not have complete high performance, high availability, security and other features from the beginning of its design. It always evolves and improves with the increase of the number of users and the expansion of business functions. In this process, great changes have taken place in development patterns, technical architecture and design ideas. Even the technical staff has grown from several people to a department or even a product line. Therefore, the mature system architecture is improved with business expansion, not overnight; systems with different business characteristics will have their own priorities, such as Taobao, to solve the search, order and payment of massive commodity information, such as Tencent, to solve the real-time message transmission of hundreds of millions of users, Baidu has to deal with a large number of search requests, they all have their own business characteristics, and the system architecture is also different. In spite of this, we can also find out the common technologies from these different website backgrounds, and these technologies and means can be widely used in the architecture of large-scale website systems. The following is by introducing the evolution process of large-scale website systems. To understand these technologies and means.
The initial architecture, applications, databases, and files are all deployed on a server, as shown in the figure:
II. Separation of applications, data and files
With the expansion of business, a server can no longer meet the performance requirements, so applications, databases and files are deployed on separate servers, and different hardware is configured according to the use of the server to achieve the best performance.
Third, improve the performance of the website by using cache
While the hardware optimizes the performance, it also optimizes the performance through the software. in most website systems, caching technology is used to improve the performance of the system. The use of caching is mainly due to the existence of hot data. Most website visits follow the 28 principle (that is, 80% of the access requests end up on 20% of the data), so we can cache the hot data and reduce the access path of these data. Improve the user experience.
The common ways of cache implementation are local cache and distributed cache. Of course, there are CDN, reverse proxy and so on. We'll talk about this later. Local cache, as the name implies, caches data locally on the application server, either in memory or in files. OSCache is a commonly used local cache component. The local cache is characterized by high speed, but the amount of cached data is also limited because of the limited local space. The characteristic of distributed cache is that it can cache a large amount of data, and it is very easy to expand. It is often used in portal websites, and its speed is not as fast as local cache. The commonly used distributed caches are Memcached and Redis.
As the entrance to the website, the application server will bear a large number of requests, and we often share the number of requests through the application server cluster. The load balancing server deployed in front of the application server dispatches user requests and distributes the requests to multiple application server nodes according to the distribution policy.
The commonly used load balancing technology hardware is F5, the price is more expensive, and the software is LVS, Nginx, HAProxy. LVS is a layer-4 cloud load balancer. Internal servers are selected according to the target address and port. Nginx is a layer-7 load balancer and HAProxy supports layer-4 and layer-7 load balancers. Internal servers can be selected according to the content of the message. Therefore, the distribution path of LVS is better than Nginx and HAProxy with higher performance, while Nginx and HAProxy are more configurable. For example, they can be used for dynamic and static separation (static resource server or application server is selected according to the characteristics of the request message).
With the increase of the number of users, the database has become the biggest bottleneck. The common means to improve the performance of the database is the separation of read and write and the separation of tables. As the name implies, the database is divided into read database and write database, and data synchronization is realized through the main and standby functions. The sub-database sub-table is divided into horizontal split and vertical split, while the horizontal switch is to split a large table in a database, such as a user table. Vertical segmentation is to switch according to different services, such as user business, commodity business-related tables are placed in different databases.
Use CDN and reverse proxy to improve the performance of the website
If all our servers are deployed in the computer room in Chengdu, the access is faster for users in Sichuan and slower for users in Beijing, because Sichuan and Beijing belong to different developed areas of Telecom and Unicom respectively. Beijing users need to go through interconnected routers to access the servers in Chengdu, and the return path is the same, so the data transmission time is relatively long. In this case, CDN is often used to solve the problem. CDN caches the data content to the operator's computer room, and the user first obtains data from the nearest operator when accessing, which greatly reduces the path of network access. The more professional CDN operators have Lanshun and Internet accommodation.
The reverse proxy, on the other hand, is deployed in the computer room of the website. when the user's request arrives, the reverse proxy server first accesses the reverse proxy server, and the reverse proxy server returns the cached data to the user. if there is no cached data, it will continue to be obtained from the application server, which also reduces the cost of obtaining data. Reverse proxy has Squid,Nginx.
Using a distributed file system
The number of users is increasing day by day, the volume of business is getting larger and larger, and more and more files are generated. A single file server can no longer meet the demand. Requires distributed file system support. A commonly used distributed file system is NFS.
Use NoSql and search engines
For the query of massive data, we can achieve better performance by using nosql database and search engine. Not all data should be placed in relational data. The commonly used NOSQL includes mongodb and redis, and search engines have lucene.
Split the business of the application server
With the further expansion of the business, the application becomes very bloated. At this time, we need to split the application into news, web pages, pictures and other businesses. Each business application is responsible for relatively independent business operations. Businesses communicate with each other through messages or share databases.
Eighth, build distributed services
At this time, we find that various business applications will use some basic business services, such as user services, order services, payment services, security services, these services are the basic elements to support each business application. We extract these services and use the partial service framework to build distributed services. Taobao Dubbo is a good choice.
That's all for "what are the techniques that java architects must master?" Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
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.