mongodbmongo-java-driveraws-documentdb

What is replacement for mongodb oplog in aws document db to listen to changes in collection?


We use oplog collection(that is present in local database) in our code to check if an event happens on a specific db and fire an event in our code.But,as aws document db doesn't support oplog as mentioned in "https://docs.aws.amazon.com/documentdb/latest/developerguide/developerguide.pdf",how can we do that?Is there an alternative approach?


Solution

  • You shouldn't use oplog even with your local mongodb. This is a deprecated approach. The modern way is to use Change Streams, which is supported by Amazon DocumentDB: https://docs.aws.amazon.com/documentdb/latest/developerguide/change_streams.html