2. large sites architectural pattern

Web site exists, high concurrency, mass data and other issues, the site made a lot of solutions, these solutions reused by many websites (because of effective and practical)

  1. Transverse cutting and longitudinal cutting
    transverse cutting are: a layered, stratified system: an application layer, the service, the data layer is
    always wanted to be cut: dividing the cut out of the same layer of different functions and services, the formation of high cohesion and low coupling, improve concurrency and scalability features

  2. Distributed
    advantage of
    even the best computer, and performance can not be general, multiple computers to compete
    distributed means more computers perform the same function, the more concurrency, data can be processed more
    disadvantages
    can lead to problems CAP
    Distributed Transaction difficult guarantee correctness and business processes will have an impact
    because of the interdependence of distributed sites, development management and maintenance difficulties, do what needs to design
    a distributed manner
    distributed applications and services: the layering and cutting modules distributed deployment
    distributed static resource: the static resource JS, CSS, images stand-alone deployment, use a separate domain name, static and dynamic separation to achieve
    distributed data and storage: distributed relational databases and non-relational distributed database
    distributed computing: the user does not intuitively feel calculation, for example, search engines index build, database statistics and other data, these should be distributed computing
    distributed transactions
    two-phase commit 2PC
    compensating transaction TCC
    distributed lock:
    database locks
    Redis lock
    Zookeeper locks
    distributed configuration: server configuration live update

Clusters
increase the availability of
a server failure, load balancing server will be transferred to another
increase concurrency

Cache
CDN
static resources, not often change resources on the operator server
reverse proxy
reverse proxy server on the business center computer room, the static cache resource site, without the need to continue to be forwarded to the service layer to return the user to the
local cache
in the application server with local storage of data, direct access to native data, without accessing the database
distributed cache
design prerequisite for
data access hotspots uneven
data is valid within a certain time, not immediately invalidated, or to access the cache, it will have dirty read

Asynchronous
traffic is divided into a plurality of stages, each stage performed by asynchronous shared data
such as distributed systems, the use of message queues for asynchronous execution
asynchronous message queue advantages of
increased system availability, when the consumer fails, does not affect the producer, the producer can continue to install the message queue
to speed up the site to respond to
the producers on the message queue, the consumer does not need to consume a timely manner, you can continue to add to the queue in
the elimination of peak concurrent access
if you suddenly have a lot of users simultaneously access the server in order processing, and placed in a queue, waiting for the end consumer order processing server

Redundancy
when a server goes down, the transfer can use this redundant data servers to other servers, continue to operate for
example, regular backups of the database, the data for redundancy, high availability
cold backup: regular backups
hot backup: Main separated from

Automated
publishing process automation
automatic code management
automatic safety monitoring
automation deploy
automated monitoring
automation alarm
automatic failover
......

Security
encryption
codes identifying
the filter information
risk control

The key technology Sina microblogging
hierarchical
distributed deployment
cluster
synchronization push -> asynchronous sliding
past, such as the distribution of microblogging star, and pushed to all fans microblogging
now, first of all pushed to the online microblogging fans, wait until the user goes online, auto-refresh drop-down, or over time pushed to your phone
multiple data centers, deployed in different areas of the room
automation tool
automates the release
safe
handling zombie powder, spam

Published 20 original articles · won praise 1 · views 1459

Guess you like

Origin blog.csdn.net/weixin_44587666/article/details/89496413