架構師訓練營 week11 總結
11.1 安全架构:Web攻击与防护
Cross-Site Scripting (XSS)
https://zhuanlan.zhihu.com/p/61773197
Sql injection
预编译和绑定变量
Cross-site request forger (CSRF)
https://blog.techbridge.cc/2017/02/25/csrf-introduction/
Others
文件上傳
路徑遍歷
將 Javascript, CSS 等資源文件獨立服務器,獨立域名
11.2 安全架构:加密与解密
單向散列加密


對稱加密

非對稱加密

密匙安全管理與加解密服務系統架構

11.3 安全架构:反垃圾与风控

Bayes' theorem
Bloom Filter
https://medium.com/@Kadai/%E8%B3%87%E6%96%99%E7%B5%90%E6%A7%8B%E5%A4%A7%E4%BE%BF%E7%95%B6-bloom-filter-58b0320a346d
電商風控系統

11.4 高可用:可用性度量
可用性指標:幾個9
故障處理流程及考核

故障的原因
硬體故障
軟體bug
系統發佈
併發壓力
網路攻擊
外部災害
11.5 高可用:提升系统可用性的架构方案
解耦
高內聚、低耦合的組件設計原則
面相對象基本設計原則
面相對象設計模式
領域驅動建模
隔離
業務與子系統隔離
維服務與中台架構
生產者消費者隔離
虛擬機與容器隔離
異步
multi-thread
async
event-driven

備份
集群
CAP (Consistency, Availability, Partition tolerance)
https://zhuanlan.zhihu.com/p/20399316
Failover
database
load balancer
how to detect, how to transfer
design no-state service
冪等
idempotent是HTTP方法的屬性,表示不管執行多少次操作請求,都將產生相同的結果。
https://www.cnblogs.com/bukudekong/p/3837696.html
事務補償
ACID
Atomicity, Consistency,
Isolation, Durability
分佈式 BASE
Basic Availability, Soft-state, Eventual Consistency
Retry
熔斷

限流
計數器算法
固定窗口、滑動窗口
令牌桶算法
漏桶算法
自適應限流

降級
異地多活
11.6 高可用:架构运维方案
Deployment

預發佈驗證
先發佈的預發佈機器上

發佈流程

灰度發佈
一次發佈部分

網站運行監控
監控數據採集
用戶行為日誌收集
服務性能監控
業務運行數據報告
監控管理

高可用的價值觀

11.7 高可用故障案例分析
經驗學習


檢查 Log 配置文件,Log Level at least need to be "Warn"
3-party Lib log Level sometimes has too many Error log, need to turn off
separate our log and 3-party's log


首頁不應該訪問 DB,
首頁的資料應該使用 cache or search engine
首頁最好是靜態的


使用鎖時要很謹慎,特別是有長時間 IO 操作的時候
使用不同的鎖在不同的場景


cache management


deployment 各個元件操作的先後順序


存儲文件的管理
根據不同的文件類型和用途分別管理
小文件不能和大文件共用儲存
批次處理用的大文件可以用其他的分佈式文件系統


production 環境的管理規範,不能讓人隨便用 production 環境


code versioning control


default 初始資料的處理
评论