简体   繁体   中英

Using MongoDB and Relational DB together

How to handle transaction issues in an environment where and databases work together?

I want to use for scalability and for transactions. (transactions are used in the inventory management system but product information is stored in a database)

There is good news: As of Mongo version 4.2, multiple document ACID transactions are now fully supported :

For situations that require atomicity of reads and writes to multiple documents (in a single or multiple collections), MongoDB supports multi-document transactions.

As a general comment to your question, there is nothing wrong with having more than one data store in your architecture. However, keep in mind that business operations which would require both Mongo and MySQL for a single logical transaction/unit, there would probably be no way to make this atomic. If you are falling into this category, then you need to rethink your database design, and just stick with one database for each business operation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM