I’m thinking of using MongoDB for an application that requires normalized data because it needs to access most entities separately. So a lot of it transactions will involve multiple documents.
I’d like to use change streams to monitor all transactions and decide whether data needs to be sent to another service. But if several documents are transacted as a unit, they need to be sent as a unit to maintain consistency.
From the MongoDB documentation, it looks like you can open a change stream on the entire database, but change events seem to be triggered separately for each collection. So it looks like a multi-document transaction will trigger several events for different collection. But what I really want is an event for the entire transaction. Is that possible with MongoDB?
If it isn’t, I guess I could make the application duplicate the contents of each transaction to a dedicated collection, and then open a change stream on that collection. But that’s a lot of overhead.