We recommend starting with a single sharded cluster when you are building a new application regardless of your immediate need for multiple shards.我们建议您在构建新应用程序时从单个分片集群开始,而不管您是否需要多个分片。
The following scenarios benefit from sharded cluster architecture:以下场景受益于分片集群架构:
Details详情
Starting with a sharded cluster is a proactive approach that offers:从分片集群开始是一种主动的方法,它提供了:
Effortless Horizontal Scaling – You can easily add shards as your application grows, without the complexity of migrating from a replica set.轻松的水平扩展-随着应用程序的增长,您可以轻松添加分片,而无需从副本集迁移的复杂性。Cost-Effective Infrastructure – MongoDB 8.0 introduces config shards, allowing you to set up a sharded cluster on a single replica set infrastructure without dedicated config servers.经济高效的基础设施-MongoDB 8.0引入了配置分片,允许您在单个副本集基础设施上设置分片集群,而无需专用的配置服务器。In MongoDB Atlas, sharded clusters with up to 3 shards in version 8.0 use config shards by default.在MongoDB Atlas中,8.0版本中最多有3个分片的分片集群默认使用配置分片。
Consider adding shards when your database reaches 60-70% of resource utilization (RAM, vCPUs, or storage) of a sizable machine. For example, in Atlas, consistent 60-70% resource utilization of an M60 machine with a 4 TB disk indicates an additional shard should be added.当数据库达到大型计算机资源利用率(RAM、vCPU或存储)的60-70%时,考虑添加分片。例如,在Atlas中,具有4 TB磁盘的M60机器的资源利用率始终为60-70%,这表明应该添加额外的分片。