什麼是Shared nothing architecture?
wiki:“A shared nothing architecture (SN) is a distributed computing architecture in which each node is independent and self-sufficient, and there is nosingle point of contention across the system. More specifically, none of the nodes share memory or disk storage”
簡單的說:
shared nothing architecture是一 種分佈式計算架構,這種架構中不存在集中存儲的狀態,整個系統中沒有資源競爭,這種架構具有非常強的擴張性,在web應用中廣泛使用。
2. 對比
Shared-nothing、shared-memory、shared-disk是並行系統最常使用的模式。
shared-memory:多個cpu共享同一片內存,cpu之間通過內部通訊機制進行通訊
shared-disk:每一個cpu使用自己的私有內存區域,通過內部通訊機制直接訪問所有磁盤系統。
和shared-memory、shared-disk相比,shared-nothing優勢明顯,在針對多用戶並行訪問的時候,通過橫向擴充資源,能夠減少response time。
3. 分片
shared noting需要確立一種分片策略,使得依據不同的分片策略,減少資源競爭。
三種基本的分片策略結構:
1) 功能分片
根據多個功能互相不重疊的特點進行分片,這種方式在ebay取得巨大成功。缺點是需要深入理解應用領域,才能更好地分片。
2) 鍵值分片
在數據中找到一個可以均勻分佈到各個分片中的鍵值。
3) 查表
在集羣中有一個節點充當目錄角色,用於查詢哪個節點擁有用戶要訪問的數據。缺點在於這個表可能成爲整個系統的瓶頸及單點失效點。
4. 現狀
shared-nothing architecture目前廣泛存在,Map-reduce、BigTable、Cassandra、MongoDB等等。
5. 擴展閱讀
Paper:The Case for Shared Nothing
http://oracle.chinaitlab.com/optimize/39626.html