简体   繁体   English

mongodb:分片能否提高查询性能?

[英]mongodb:Can sharding improve query performance?

嗨,我有一个数据量很大的表,分片能否提高查询性能?

If you generate an appropriate key that allows MongoDB to shard (see their documentation on how to do this), and you have multiple disk drives, then the simple answer is yes. 如果您生成一个允许MongoDB进行分片的适当密钥(请参阅有关其操作方法的文档),并且您有多个磁盘驱动器,那么简单的答案是肯定的。

At their last major pre-release (when sharding was demo'd), they have an 8-server configuration, each with sharding, and were getting a million rows/sec. 在他们的最后一个主要预发行版中(在演示分片时),它们具有8服务器配置,每个服务器都具有分片,并且每秒获得一百万行。

It depends... If there are a lot of concurrent reads/writes going on, they potentially yes. 这取决于...如果正在进行大量并发读取/写入,则可能是。 However if it is just a single process accessing a dataset which resides on a single (local) host then probably not. 但是,如果仅是单个进程访问驻留在单个(本地)主机上的数据集,则可能不会。

Also, mongodb is a key-value type database, so it is very optimized for single value lookups. 另外,mongodb是键值类型数据库,因此对于单值查找进行了非常优化。 Basically, more is needed about your use case to give you a good answer. 基本上,需要更多有关用例的信息,才能为您提供良好的答案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM