ChangeStream scalability

Is ChangeStream based solely on primary’s oplogs or also secondary’s oplogs in the replicaset? Can reading of ChangeStream through reading secondary’s oplog and scale out secondary numbers in the replicaset? I can’t find any documentation on this specific point. If it is solely based on primary’s oplogs, then the scalability story is through sharding the cluster only? Thanks

Hi @Hao_Zhang,

Welcome to MongoDB community.

As far as I know change stream is based on an aggregation stage eventually. Aggregation respect a readPreference of your connection and therefore you can read from secondary and use change stream if you understand all secondary reads implications.

There is a caveat that only majority commited data is visible on change streams.

Thanks
Pavel