Let's assume I have two data centers each with 3 instances running the same code connected to a single MongoDB and separate Redis databases.
Redis A <----> Data Center A
|
|--------> MongoDB
|
Redis B <-----> Data Center B
The expectation is that when a certain collection in Mongo is updated, a change stream in both Data Center A and B will be triggered to clear the redis cache. Will it work with change streams?
When you have a changestream code running on n nodes/instances each instance will receive the change event and based on that event & data from changestream you can do your businesslogic/redis cleanup.