[英]mongo db insert big collections
I have a mongo (version 2) in production in replicaset configuration (the next step is to add sharding). 我在副本集配置中正在生产中使用mongo(版本2)(下一步是添加分片)。
I need to implement the following: 我需要实现以下内容:
My current implementation of loading is: 我当前的加载实现是:
One of the thing I see is that because of mongoDB lock my total performance getting worst during the loading. 我看到的一件事是,由于mongoDB锁定,我的总性能在加载期间变得最差。 I've checked the collection with up to 10Million entries.
我已经检查了多达1000万个条目的集合。 For more that that size I think I should start use sharding
对于更大的尺寸,我认为我应该开始使用分片
What is the best way to love such issue? 爱这个问题的最好方法是什么? Or maybe should I use another solution strategy?
还是应该使用其他解决方案策略?
You could use two collections :) 您可以使用两个集合:)
Then, next day, repeat the above just swapping A and B :) 然后,第二天,重复上述操作,只是交换A和B :)
This will let collectionA still service requests while collectionB is being updated. 这将使collectionA在更新collectionB时仍可以处理请求。
PS Just noticed that I'm about a year late answering this question :) PS刚注意到,我回答这个问题迟到了一年:)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.