Author: @Hsu Tzu Ting Date: Dec 3, 2020 Tags: 延伸閱讀 性質: Tech Share
升級到不能升級
有些小問題一變大就不簡單了
Scalability 討論的就是系統應對問題大小的能力
憑什麼說 Database A 比 Database B 更 scalable?
How to improve the scalability?
Replication
Asynchronous replication (非同步)
優點:offers ease of use (replications 在背景執行)
缺點:資料遺失的風險較高
Synchronous replication (同步)
Single-leader architecture
Multi-leader architecture
No-leader architecture
pioneered by Amazon's DynamoDB
no leaders, every replica can accept writes
優點
缺點 / 問題
Partition
一份資料,切開變成數個小份後,分散的放到不同的 node 上面
Why improve scalability?
Strategies
Range partition
List partition
Hash partition (index-organized table)
Composition partition
Method
Vertical
Horizontal
可以只有 Partitioning 沒有 Replication 嗎?
現實:網路會斷線
https://rickhw.github.io/2018/06/18/Architecture/Gossip-in-Distributed-Systems/
對象 → read-write storage
What's C, A, P stand for?
Consistency(一致性)
使用者讀到的「總是」最新的資料
not consistency 的例子
Availability(可用性)
Partition tolerance(分區容錯性)
Core of the Theorem → Trade-off
CA
CP
AP
Be careful
What is Database Replication and How Does it Work?
Partitioned Tables and Indexes