Bulk insert performance in MongoDB for large collections

后端 未结 3 1613
北海茫月
北海茫月 2020-12-15 21:48

I\'m using the BulkWriteOperation (java driver) to store data in large chunks. At first it seems to be working fine, but when the collection grows in size, the inserts can t

3条回答
  •  庸人自扰
    2020-12-15 22:24

    1. Do have any index in your collection? If yes, it has to take time to build index tree.
    2. is data time-series? if yes, use updates more than inserts. Please read this blog. The blog suggests in-place updates more efficient than inserts (https://www.mongodb.com/blog/post/schema-design-for-time-series-data-in-mongodb)
    3. do you have a capability to setup sharded collections? if yes, it would reduce time (tested it in 3 sharded servers with 15million ip geo entry records)

提交回复
热议问题