架構師訓練營 week4 總結

用户头像
ilake
关注
发布于: 2020 年 10 月 11 日

系统架构:系统技术挑战与方案

Challenge

  • High concurrence

  • Large traffic

  • High availability

  • Mass data

  • Global service, complicated network

  • security

  • Change often, deploy often



Vertical expansion => single server

  • RAID => I/O

  • SSD => I/O

  • Add memory

  • Upgrade network interface

  • More process or threads

Horizontal expansion => multiple servers

分布式架构演化

0.simple





  1. Separate data and application



  1. Use cache



  1. Application cluster



  1. Read and write separation



  1. Reverse proxy and CDN



  1. Distributed file systems and distributed databases



  1. No SQL, Search Engine



  1. Business separation



  1. Microservice and Middle Platform



架构模式与要素

Multi Layers: 
  • Horizontal split

  • ex:

  • nginx

  • application

  • database



Vertical split
  • Separate different services

  • micro-services



Distributed
  • Distributed applications and services

  • Distributed static resources

  • Distributed storage systems

  • Distributed computing



Cluster
  • Same services same cluster



Cache
  • CDN

  • Reverse proxy

  • Local cache

  • Remote cache



Asynchronous
  • Increase speed of response

  • Increase high availability

  • Reduce high concurrence



Redundancy
  • Backup, incase server down



Automation
  • Operation maintenance



How to measure a system
  • High performance

  • High availability

  • Scalability

  • Easy to add new server to cluster?

  • Expandability

  • New Features 

  • Security



Frontend architecture
  • App, Web tech stack

  • Browser, Http, tunning

  • CDN

  • Dynamic and static separation

  • Image service

  • Reverse proxy

  • DNS



Gateway and application architecture
  • Load balance

  • 動態頁面靜態化

  • Separate business 



Service architecture
  • Micro-service

  • Distributed queue

  • Distributed cache

  • Distributed lock system



Storage architecture
  • Distribute file systems

  • Distribute databases

  • NoSQL



Big data
  • Search engine

  • Recommendation engine

  • Dataware house



Operation and security
  • Data collection and display

  • Data monitor and alert

  • Prevent attacks

  • Data encryption and decryption

架構案例 - wiki

GeoDNS: Proxy DNS to nearby server

LVS: Linux Virtual Server, like load balancer on Linux

Squid: reverse proxy

Lighttpd: Security, speed, compliance, and flexibility web server

PHP: web programming language

Memcached: distributed cache system

Lunce: search engine

Mysql: database



Performance optimization: most operations are read



Frontend Performance optimization
  • DNS

  • CDN

  • There is no dynamic info in content => prevent catch expired or include expired data

  • LVS

  • Dispatch to Squid

  • Reverse proxy (Squid)

  • Catch frequent content here



Server-side performance optimization
  • Use best servers on PHP part

  • Use Imagemagick to handle image processing

  • Use Tex to format tex, especially transform science formula to image



Backend Performance optimization
  • Cache, storage, database

  • Frequently used data cache in application local cache => every small but really high-frequency reading

  • Cache content is the format that the application can use directly. Ex: HTML. Reduce processing cost

  • Use cache server to save session 

  • Memcached Persistent connection is very cheap



Mysql Performance optimization
  • increase memory

  • RAID0, high performance but low availability (use backup to solve)

  • Low Transaction consistency, speed up recovery

  • If master server down => use slave, but close the write operation



架構案例 - Taboo

Team Goals:

  • The rapid development of the company's business

  • Concurrent product team development

  • System scalability



Evolution

  1. Stand-alone architecture

  2. Multi-machine

  3. Distributed cache

  4. Server cluster

  5. Database read and write separation

  6. CDN acceleration and reverse proxy

  7. Distributed file server

  8. Database sharding

  9. Search engines and NoSQL



用户头像

ilake

关注

还未添加个人签名 2019.04.15 加入

还未添加个人简介

评论

发布
暂无评论
架構師訓練營 week4 總結