英文:
Are there performance concerns with changeStreamPreAndPostImages enabled?
问题
启用带有文档前图像和后图像的更改流是否存在性能问题?
目前,我使用.watch()
来监视insert
和updated
,我真的很想在deleted
之前看到文档。
我已经使用Collection.findById()
来获取关于已更新的文档的更多详细信息,所以我想知道前图像或后图像是否会对MongoDB服务器产生显着更大的负载?
英文:
Are there any performance concerns with enabling change streams with document pre-images and post-images.
Right now I use .watch()
for insert
and updated
and I would really like to see the document before it's deleted
.
I also already use Collection.findById()
if I need more details about a document that has been updated so I'm wondering if pre-images or post-images will be a significantly larger load on the MongoDB server?
答案1
得分: 2
每次启用预映像后,对集合的每次更新都会伴随额外开销,因为将会向存储预映像的特殊集合添加一条记录。如果对集合的更新频率非常高,您可能会注意到一些影响。此外,带有预映像的集合会占用存储空间。从这个特殊集合中检索图像到更改流非常高效。
英文:
After enabling pre-image, each update to the collection comes with an overhead, as there will be a record added to the collection that stores pre-images. If the rate of updates to the collection is very high, you may notice some impact. Also the collection with pre-images is using storage space. Retrieveing an image into a change stream from this special collection is pretty efficient.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论