DEV Community

Discussion on: How I stored data in two different databases simultaneously

Collapse
ianwijma profile image
Ian Wijma

Just my thoughts. Wouldn't it be better to write a queue that pushes new users to the CRM rather than doing it on the fly? This enable you to retry syncing if something goes wrong.

Collapse
sankalpswami1122 profile image
Sankalp Swami Author

Yep we can do that but the requirements for the project were different and that was the reason why i opted for this.

Collapse
ianwijma profile image
Ian Wijma

That's fair enough, you can't always do the most fancy solution out there.

Thread Thread
sharpninja profile image
Info Comment hidden by post author - thread only visible in this permalink
The Sharp Ninja

Yeah, but a transaction to ensure the data made it into both databases should have been a requirement. Then you only make one API call and write to both ACID databases in the API. You are using ACID compliant databases... right?

sankalpswami1122 profile image
Sankalp Swami Author

Actually its not an acid compliant database. Their tech stack had mongodb

Thread Thread
sharpninja profile image
The Sharp Ninja

They have a CMS that you have to pay for that doesn't do transactions? I get that it's a startup, but eventualy they have to start using real tech.

Thread Thread
jzombie profile image
jzombie

I haven't used transactions in MongoDB directly, but apparently it's supported: docs.mongodb.com/manual/core/trans...

Some comments have been hidden by the post's author - find out more