纵向拓展:增加单机的资源
横向扩展:增加机器数据(主流)--》数据分片保证系统的水平扩展,通过数据复制,保证数据的高可用性
为了满足横向扩展,常用的模型为二级映射,一级映射是key-partition映射 将数据映射到数据分片空间;二级映射是partition-machine映射,将数据分片空间映射到物理机器中,使数据和机器通过 数据分片空间 解耦,这样便于增加机器。
解耦的灵活性体现在使用的Hash方法了,常见的有一致性Hash和Range Partition(映射表中存的是key的最小值和其对应的机器)
解耦方法最广泛应用的也就是一致性哈希