How to sync SQL Server data to MongoDB

ma8fv8wu  于 12个月前  发布在  SQL Server
关注(0)|答案(1)|浏览(97)

I have a table in SQL Server, and I have to sync the data to MongoDB for r/w separation. The table was inserted/updated/deleted so often that the SQL Server was not able to be stopped.

Is there an experienced way to implement that?

ggazkfy8

ggazkfy81#

A proper answer to that is probably going to be beyond the scope of the question as posed, but things like workload (lots of data? heavy volume? network toplogy), SLAs (how fast, how often, how foolproof, can you have down time?) and synchronicity (See Brewers Cap Theorem ), will dramatically change what is or isnt reasonable as an approach.

A naive answer might be as simple as "write the data to a csv once a day, then feed those into mongo via a script".

On the other side of the coin, there are ETL tools and libraries out there which I'm sure specialize in moving lots and lots of data as quickly as possible between your two storage engines. In fact I believe there's an ODBC driver for mongo which is a standard you can find in products from microsoft, oracle, open source, and everything in between.

A happy middle ground might just be a lightweight application or a script whos job it is to fire off documents one by one (or in batches) off of a queue till its empty. App reads sql, writes mongo, and handles any distributed transaction logic you may wish to impose.

相关问题