One of the typical processes of Internet Architecture Evolution

Source: Internet
Author: User
Tags database sharding

Statement, this articleArticleThe author isBluedavy, Not me. I think it is well written. I will extract useful chapters from them, leave them for my notes, and share them with you.

Step 1: physically separate the application database

In the initial phase of website operation, there will always be downtime during peak hours every day, and database and website applications will often compete for hardware resources. In this case, the simplest solution is to deploy applications and databases separately on different machines to improve their respective resources. (This solution is the initial stage of website construction)

Step 2: page caching and static

As the website traffic increases rapidly, the system response slows down, mainly because the number of database connections increases and the hardware configuration of the database server determines that only a certain number of connections can be provided. Because many content on the website is rarely updated. Therefore, these pages can be cached or static to reduce access to the database. This step requires technical requirements: Page Cache Technology and template technology. Page cache proposalSquidAnd other static solutions, you can generate staticHtml.

Step 3: Page fragment Cache

Page fragment cache can be usedESI,OscachedAnd other frameworks.

Step 4: Data Cache

Data Cache can be used Ehcache , Oscache Or an independently implemented cache framework. Technical requirements for this evolution: Map Data structure,ProgramLanguage Map Data structure (for example Java In Hashmap , Treemap And so on.AlgorithmAnd failure algorithms)

Step 5: horizontally Scalable Application Servers

If the load on the server is too high due to a high access volume, you can only add application servers and enter the horizontal scaling stage. How can we evenly distribute access requests to each application server. Here we first use the software load balancing technology. Optional software Load Balancing Technology: DNS Round Robin, Apahce , Nginx , LVS . How can we keep the information synchronized? Session Synchronization. You can use information to write data to the database, write data to shared files, Cookie Or synchronize the status information on each machine. How to ensure data cache synchronization? Cache synchronization or distributed cache can be used. How to Make file-related functions available For example, the file upload function. A common file system or storage device can be used, and most of the former can be used. The knowledge to be accumulated in this step is: 1. Server Load balancer technology, including but not limited to Hardware load balancing (layer-4, layer-7, etc.), software Load Balancing Technology, Server Load balancer algorithms, forwarding protocols, (such VS/NAT , VS/TUN , VS/DR ) Implementation Details of the selected technology (such LVS . 2. Disaster Tolerance Technology, including but not limited ARP , Linux heart-beanting . 3. Status information or cache synchronization technology, including but not limited Cookie , UDP Implementation of the Protocol, multicast, and data synchronization frameworks (for example Jgroups ). 4. Principles of common rural documents , For example NFS And so on

Step 6: Database sharding

after the preceding steps are completed, your team can do a variety of minor optimization jobs, such as operating system tuning, apache optimization, JVM optimization and so on. The implementation of database sharding has no high technical requirements. It only involves organizing the business, splitting the database, and modifying the program accordingly.

Step 7: Sub-tables,Dal, Distributed cache

Because the database data volume is too large, database sharding is often unable to solve the slow system. In this case, appropriate table sharding and database optimization are required. Because the server does not have so much memory to provide cache, therefore, distributed cache is adopted. Problem: The obvious problem was found during table sharding: After Table sharding, the complexity of accessing the database increased. Because table sharding rules must be taken into account when querying tables. To unify this layer The best way is the famous Dal . Adds a data access layer. Available distributed cache solutions: Memcache , Jbosscache . Knowledge reserve during table sharding: Dynamic Hash , Consistent hash , Distributed cache implementation principle, database connection management, database operation control, etc.

Step 8: Change the horizontal scaling environment of Application Servers

When Apache , Nginx Or LVS When the software load balancing method is unable to withstand the scheduling pressure of a large amount of traffic, you can consider purchasing a hardware Load Balancing Device. Inbound F5 , Netsclar , Athlon You can also create different service software load cluster groups from the business perspective. When there is a bottleneck in the file sharing solution, you can consider buying expensive storage devices. . For example NAS You can also consider designing your own or adopting a mature distributed file system.

Step 9: data read/write splitting and low-cost storage

If the number of servers is increased too much, the database connection is fierce, and the read/write ratio is quite high. In this case, you can component a large database cluster or data read/write splitting. Optional data read/write splitting solutions or program-level synchronization solutions, which must be synchronized and transformed when implementing read/write splitting Dal To adapt to the new evolution. Low-cost storage Google Of Bigtable , Sina's Memcachedb . Knowledge reserves: database self-replication, synchronization solutions and implementation principles (such Oracle Of Standby , MySQL Of Replication ); Data latency and non-persistent solutions. Read/write splitting rule judgment.

Step 10: the era of large-scale distributed applications

LAn obvious requirement after being split into distributed systems is efficient and stable communication and calling frameworks.

LManages large-scale distributed applications, including luyou,, versions, Error Tracking, detection, and alarms.

LReasonable splitting involves business arrangement and grasp of large-scale system architecture.

This step involves a lot of knowledge systems: communication, distributed calling, distributed transactions, messaging mechanisms, parallel computing, reports, detection technology, rule policies, etc.

 

The above is a typical process of the evolution of Internet architecture.

Related Article

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.