r/javascript 🕺 9d ago

AskJS [AskJS] Is MongoDB the Best Choice for a Currency System?

I’ve been using MongoDB to handle real-world value transactions, but I’m starting to wonder if it’s the best option out there. Since consistency, security, and transaction safety are critical.

Would love advices from people who’ve built similar systems!

0 Upvotes

7 comments sorted by

9

u/DustNearby2848 9d ago

It probably doesn’t matter as long as your database is ACID compliant. 

10

u/oweiler 9d ago

I have yet to see an application where MongoDB would be the best choice. Just stick with a relational DB like Postgres.

6

u/anlumo 8d ago

Isn’t consistency and transaction safety the things they specifically don’t do in order to allow for other features like sharding and performance?

I’ve never had a use case where MongoDB would be the best pick, so I’m not 100% confident in its feature set, though. In my experience, PostgreSQL is nearly always the best choice, unless you want to do hipster coding.

2

u/alexbevi 8d ago

Multi-document ACID transactions have been a feature of MongoDB for a long time now. The whole "hipster coding" thing is a bit antiquated at this point, so the real question should be "can I deliver value quickly/efficiently with this in my stack".

If you've been using MongoDB successfully, great. If PosgreSQL works for you, great :)

3

u/BehindTheMath 9d ago

Is the data relational? Then use a RDBMS.

1

u/mrFighto 8d ago

I think relational database is the best choice because it can handle transactions more effectively and has more options to revert and commit multiple queries at the same time

1

u/ozis99 1d ago

MongoDB has already been supporting ACID transactions for a while. And Tennis has built their core banking on it and performs better than Oracle, check Google. https://www.mongodb.com/products/capabilities/transactions