cost of observing large collection with oplog tailing

烂漫一生 提交于 2019-12-25 03:12:27

问题


I have some large collections which need to be observed for changes. In the old days of polling the whole collection would be compared to the in-memory version every 10 seconds in order to determine if something has changed.

With oplog tailing, this is not necessary anymore. Is it still expensive to have an observe without any parameters or is this a good way to create a trigger on a collection?


回答1:


The current implementation of Oplog Observe Driver (as of Meteor 0.8.1) would require all published documents to be in memory cache. i.e. if you have 3 different but overlapping observes on a collection, each document that is observed by at least one of the observes will be stored in the cache for each observe separately. But if there are multiple observes with the same arguments like selector, fields projection, sort and limit - observe driver would be shared between them.



来源:https://stackoverflow.com/questions/23429049/cost-of-observing-large-collection-with-oplog-tailing

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!