Suhas Shelar
Suhas Shelar

Reputation: 983

Data synchronization between mysql and mongodb databases

My application's primary database is MySQL and I use MongoDB as a buffer/secondary database.

So when there is a save/update operation in the MySQL, for certain cases, some part of the data is also pushed into the Mongo datbase.

The problem that I am facing is that after I try the save/update operation in MySQL, if the later insert/update operation into the MongoDB failed, I don't have way to bring it back in sync.

Is there a way by which I can achieve this synchronization ?

Upvotes: 0

Views: 1165

Answers (1)

Poorna Subhash
Poorna Subhash

Reputation: 2128

If your application can tolerate the delay in update to mongodb, push a message to some QUEUE process and have a listener which does retries to save it to mongodb. All implementation depends on language and frameworks you are using.

Upvotes: 1

Related Questions