MongoDB教育訓練-20211223-03
vertical scaling 垂直擴展(升級到某個程度,會很貴並有極限)
horizontal sacling 水平擴展 (比較省成本)
沒有一定要shard(如果資料不多不需要,管理複雜度高)
- why learn about sharding now?
- you might not need to shard for years
- but decisions you make about schema design befoe that matter
- start planning for sharding on day one
mongos 屏蔽所有細節
configuration server 決定資料分布
修改分片鍵
選擇分片鍵原則
shard keys 不一定是要一樣的,重複的不可超過64MB
預分片
範例 1000億筆資料
YCSB壓測工具
完全停止
分散多筆sharding ,利用換取CPU計算