1. 概念
什么是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 no
single 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.htmlhtml