Best way to replicate data from MongoDB to SQL Server on Azure

We are planning to use MongoDB as API layer and would like to establish data replication between MongoDB and SQL Server. Looking for best options and suggested methods to replicate data other than CDATA approach.


Hi @Thulasi_Yemmela and welcome in the MongoDB Community :muscle: !

First things that comes to mind here would be to use the MongoDB Kafka source connector to feed kafka topics which can then be consumed by whatever to replicate the MongoDB write operations into SQL Server.
This would probably be kinda safe because you can replay, restart, etc the consumers as much as necessary. If the consumers lags a bit behind, it’s fine etc.

Another way to do it would be to directly plug your replication system to the MongoDB Change Streams but this would be a bit more complex to handle if you crash and need to start over. You can restart a change stream in the past if you want, up until the moment where the oplog windows is past that point and then you are out of sync for good…


PS: I didn’t say it but whatever you are trying to serve with SQL server, MongoDB can also serve it directly without the need for a complex replication system… :wink:


I want to concur and emphasis

1 Like

Look at

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.