Let's take a look at our technologies and briefly talk about the technical architecture design of some large websites. Technologies and tools involved: java, springmvc, ibatis, freemarker, mysql, mongdb, memcached, ehcache, and maven. It is impossible for a website to design a perfect architecture that can take into account all the situations at the beginning. A mature architecture changes with the demand and traffic increases. Basic Architecture: web server: ngnix + apache Load Balancing technical architecture: freemarker + springMVC + ibatis (myIbatis) + memcache + mysql: Generally, when the average daily UV of a website is tens of thousands or tens of thousands, deploying several web machines is basically enough. 1. As the traffic increases, the homepage is designed to be optimized by database sharding. Database sharding can be performed based on the division of business modules to reduce the pressure on a single database. 2. Table sharding is performed on tables with a large data volume to reduce the data volume of a single table and increase the query speed. 3. After database sharding, Master/Slave databases can be processed for core databases to separate queries from updates to improve the insertion speed. 4. Sort out the business. For data with a large write volume such as dynamic data, mongdb can be used to achieve higher performance and simpler business processing. At this level, the database is almost the same. When new businesses come in, the database can be scaled horizontally with ease. 2. As the business becomes more complex and databases and tables are sharded, some business processes may be very long. As a result, the application needs to query or update N tables in N databases, in this way, the client response will be very slow, and asynchronous debut is required at this time. Recommendation: JMS, activeMQ, which has good implementations. Iii. the cache server and website have some basic information, such as website configuration information and login user information. Such core data is read almost every request, however, this data does not change very much. Every time you need to go to the memcache cache server to read the data, communication between servers also takes time. You can consider local cache. Recommendation: EhCach. It is a pure Java in-process cache framework and features fast and efficient. Iv. Static. The website homepage, the second-level domain name homepage, and other pages similar to the home page have a relatively large access volume and are static. A scheduled task can be generated every several minutes. Recommended: Quartz. Open-source job scheduling framework. (In fact, this should be integrated at the beginning, because your website will certainly have similar requirements for scheduled tasks. Quartz is the best choice ). 5. static file optimization. 1. This is html, js, and static images. There are many optimization solutions, such as js componentization, on-demand loading, and css sprite. Front-end optimization is profound and profound, I will not talk about it here. There are many solutions on the Internet, which is a long-term optimization and task. 2. There are also many open source solutions for static file storage, distributed file storage, MogileFS, HDFS 6, and business decoupling. As the system becomes more and more complex, it is like a huge machine. All functional teachers are developing on it. New users and old birds are none of them. Apart from some senior programmers and architects, other people may not be able to understand the entire system, which may easily cause bugs. Publishing becomes a nightmare. As long as there is a problem with personal functions, the entire system cannot be released, and everyone has to stop, this results in a lot of waste of resources and serious overtime work. At this stage, the system must be split and divided by business, such as the user module, blog module, and image module. Each module communicates with each other through external interfaces. Each module can be independently developed and deployed without affecting each other.