什么是mognodb分片集群
官方描述
Sharding is a method for distributing data across multiple machines. MongoDB uses sharding to support deployments with very large data sets and high throughput operations.
自己的理解
- 横向拓展,解决单台服务器磁盘不够用的问题
- 将写入压力分散到各个分片
为什么要使用分片集群
- 复制所有的写入操作到主节点
- 延迟的敏感数据会在主节点查询
- 单个副本集限制在12个节点
- 当请求量巨大时会出现内存不足
- 本地磁盘不足
- 垂直扩展价格昂贵