I've been using MongoDB to manage real-world transactions involving currency, but I'm having second thoughts about whether it's really the best database choice for this type of application. Consistency, security, and safe transactions are super important to me, so I'm looking for insights from anyone who's developed similar systems. What do you think?
4 Answers
Relational databases are usually the better choice for handling transactions, particularly when it comes to effectively committing or rolling back multiple queries. They're just more equipped for these scenarios than MongoDB.
It's important for your database to be ACID compliant, so as long as MongoDB meets that, you should be fine. But keep in mind, the best choice can also depend on your specific needs.
If your data is inherently relational, it definitely makes sense to go with a relational database management system (RDBMS). It's just better suited for this kind of transactions.
You raise a good point about consistency. MongoDB often sacrifices that for features like sharding and scalability. In most cases, PostgreSQL seems like a more solid choice unless you're going for something trendy. Just my two cents!
MongoDB has actually had multi-document ACID transactions for a while now, so that argument is getting a bit outdated. If it works well for your project, then stick with it! But PostgreSQL is always a reliable option too.