Features large Internet software systems
- High concurrency, high flow
- High Availability
- Massive Data
- Users widely distributed, network complexity
- Poor security environment
- Demand for rapid change, frequent release
- Progressive Development
Large development site architecture evolution
- The initial stage: all resources applications, databases, files, etc. in a single server
- Separation of application services and data services
- Use caching to improve Web site performance: the local cache and remote caching
- Use the application server cluster to improve the ability of concurrent processing site
- Database separate read and write
- Use a reverse proxy and CDN acceleration response website
- Using distributed file systems and distributed database systems
- And using the NoSQL search engine
- Business Split
- Distributed Services
Site architecture model
- Stratified
Application layer, service layer, data layer
- Split
Press service splitter, logically or physically can also be deployed independently.
- distributed
Distributed applications and services, distributed static resource, and distributed data storage, distributed computing, distributed configuration, distributed lock, distributed file
- Clusters
More than the same application server deployments constitute a cluster, to provide services jointly through load balancing device
- Cache
CDN, reverse proxy, the local cache, distributed cache
- asynchronous
It is divided into a plurality of operational phases, between each stage by writing performed asynchronously shared data.
Features: improve system availability, speed up site responsiveness, eliminate peak concurrent access
- redundancy
Server redundant operation, data redundancy: When a server goes down, you can access its services and data transfer on to other servers
- automation
Publishing process automation, automated code management, automated testing, automated security testing, automated deployment, automated monitoring, automatic alarm, automatic failover, automatic demotion, automated allocation of resources
- Safety
Common security attacks: XSS attacks, SQL injection, CSRF attacks
The core elements of the architecture of large sites
- performance
Related indicators: response time, concurrent, certain performance counters (described server operating system or some performance metrics data)
- Availability
Availability indicator
Fault Classification and weights
- Flexibility
By means of continuously adding servers to the cluster to ease the rising pressure and concurrent user access to growing data storage requirements
- Expansibility
When the new site business products, can achieve no effect on the existing products transparent, without any alteration or modification of existing business functions can be little more than a new product line
- safety
Measuring a site's security agencies Standard: for current and potential attacks and theft means, if there is reliable coping strategies.
Methods for measuring performance
- Performance Testing
To upgrade the performance of the system for the initial planning expectations, constant pressure on the system, verification system in the Resources Section acceptable range, whether it can achieve the performance bottleneck.
- Load Test
The system continue to increase concurrent requests to apply pressure until an item or a number of performance indicators system reaches safety threshold.
- pressure test
Exceeds safe load, the system continues to apply pressure until the system crashes or can not handle any request.
- Stability Test
The system was tested under specific hardware, software, network environment, the system load to a certain business pressures, to make the system run for a longer period of time, in order to verify that the system is stable.
WEB front-end performance optimization
- Browser access optimization
Means: reduce http requests using a browser cache, enable compression, CSS page on top, JavaScript on the bottom of the page, Cookie reduce transmission
- CND accelerate
General cache static resources such as images, documents, CSS, Script script, static web pages
- Reverse Proxy
Role: website security, configure the cache to accelerate Web requests through the load balancer to build a cluster to improve system capacity, high concurrency to improve performance.
Application Server Optimization
- Distributed Cache
Website performance optimization first law: priority to use caching to optimize performance
- Asynchronous operation
Of asynchronous message queuing calls - anything that can be done should be delayed things later.
- Using cluster
Avoid single server load due to excessive pressure and slow response
- Code optimization
Focus on: multithreading (will not stateless object design objects, use local objects, concurrent access to a resource using locks), resource reuse, data structures, garbage collection, etc.
- Storage Performance Optimization
Mechanical hard vs. SSD, B + tree vs.LSM tree, RAIDvs.HDFS