简体   繁体   中英

mongo DB change strem with load balancing in production env

mongo change stream with load balancing

Can any one help as how we can achieve mango change stream with load balanceing server..? we are working on micro service architecture facing issue on production when i go with load balanceing the same code is deployed over the 4 server when i perform any operation on single server the change stream trigger is fired form all the 4 server. So what i want it should be trigger from same server where the operation are performed

Thanks in advance

Change stream is a database-level concept. Data is inserted/updated/deleted from the database, this produces change events. Any number of subscribers can subscribe to the change events and do whatever they want to do with the changes. Each subscriber is notified of every change event.

A change stream is not meant to inform the application that originated the change of the said change. This is redundant - the application already knows what it did.

Consider rephrasing your question to explain what you are trying to accomplish better.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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