4

From MongoDB's webpage I understand that they are not supporting transactions fully, if any.

I wonder if they are ever going to support it in the future so that I can store financial information in them, instead of using a RDBMS for it.

And how is it with CouchDB, do they support transactions?

Community
  • 1
  • 1
never_had_a_name
  • 90,630
  • 105
  • 267
  • 383

3 Answers3

5

Neither of these supports transactions in the sense of the more traditional RDMS - and it's unlikely they will - it's a tradeoff, supporting transactions in a distributed system is non-trivial and expensive.

MongoDB does not have ACID properties, and likely never will. CouchDB does give you ACID (I'm not sure if it does by default).

Both allows you to perform simple atomic operations on data, such as simple add/subtract on values though.

See also

Can I do transactions and locks in CouchDB?

MongoDB transactions?

On that note, this podcast with one of the MongoDB guys should give you an brief overview of the problems many NoSQL systems tries to solve, and the tradeoff they make.

Community
  • 1
  • 1
Anonym
  • 7,345
  • 8
  • 35
  • 32
  • 2
    +1 for mentioning that podcast. It's one of the best explanations I've heard. – Ben Hoffstein Aug 24 '10 at 01:27
  • 1
    There will be support for single server durability in Mongodb in the future so they will support D. See http://blog.mongodb.org/post/908172564/mongodb-1-6-released – TTT Aug 24 '10 at 05:21
  • This answer is outdated. As of 4.0, MongoDB supports multi-document ACID transactions. https://www.mongodb.com/blog/post/mongodb-multi-document-acid-transactions-general-availability – Grigori Melnik Jun 28 '18 at 10:54
0

Yes, MongoDB does't support transaction out of the box, but you can implement optimistic transactions on your own. I wrote an example and some explanation on a GitHub page. I hope you'll find it useful.

rystsov
  • 1,868
  • 14
  • 16
0

Major development: starting the next version, multi-document ACID transactions with snapshot isolation and all-or-nothing guarantees are supported by MongoDB.

See more in the announcement made by Eliot Horowitz, MongoDB's CTO and co-founder.

Grigori Melnik
  • 4,067
  • 2
  • 34
  • 40
  • And now in general availability - https://www.mongodb.com/blog/post/mongodb-multi-document-acid-transactions-general-availability – Grigori Melnik Jun 28 '18 at 10:55