简体   繁体   English

在生产数据库上导入Mongo

[英]Mongo Import on a Production DB

I have a production system which is running with thousands of user profiles. 我有一个生产系统,其中运行着数千个用户个人资料。 These profiles were added by us at the time of launch after which users have added/updated more data into it. 这些配置文件是在启动时由我们添加的,之后用户向其中添加/更新了更多数据。 Now, we are planning to add around 20K more profiles into the system. 现在,我们计划向系统中添加大约2万个配置文件。 These 20K Profiles are present in our staging mongo instance. 这些20K配置文件存在于我们的暂存mongo实例中。

What would be the best approach to get these profiles on Production instance considering there will be constant read/writes happening on the system? 考虑到系统上会不断发生读写操作,在生产实例上获取这些配置文件的最佳方法是什么? Also, we want to make sure if there is any common user than his profile should not be altered as he might have made some changes to it. 此外,我们要确保是否有任何普通用户而不是个人资料,因为他可能已经对其进行了一些更改。

I was thinking of using mongorestore as it guaranties to insert documents and not update. 我正在考虑使用mongorestore,因为它可以保证插入文档而不进行更新。 What would be the risk involved? 会有什么风险?

Thanks 谢谢

As always - test it first! 与往常一样-首先进行测试!

If your unhappy with mongorestore's impact on loadthen a custom python script will give you more granular control. 如果您对mongorestore对负载的影响不满意,那么自定义python脚本将为您提供更精细的控制。 This will allow you to put whatever business logic and checks you need and potentially add some flood limitations. 这将允许您放置任何业务逻辑并检查所需的内容,并可能增加一些洪水限制。

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

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