Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>without going into the specifics of your plan, I thought it might first be useful to go over mongoDB's support of ACID requirements.</p> <p>Atomicity: Mongo supports atomic changes for individual documents. Typically, the most significant atomic operations are "$set" and findAndModify Some documentation on these operations and atomicity in mongoDB in general:</p> <pre><code>http://www.mongodb.org/display/DOCS/Atomic+Operations [http://www.mongodb.org/display/DOCS/Updating#Updating-%24set][1] http://www.mongodb.org/display/DOCS/findAndModify+Command </code></pre> <p>Consistency: Difficult to achieve and quite complex. I won't try to summarize in this post, but there is a great series of posts on the subject:</p> <pre><code>http://blog.mongodb.org/post/475279604/on-distributed-consistency-part-1 [http://blog.mongodb.org/post/498145601/on-distributed-consistency-part-2-some-eventual][2] </code></pre> <p>Isolation: Isolation in mongoDB does exist for documents, but not for any higher levels. Again, this is a complicated subject; besides the Atomic Operations link above, the best resource I have found is the following stack overflow thread:</p> <p><a href="https://stackoverflow.com/questions/3736533/why-doesnt-mongodb-use-fsync">Why doesn&#39;t MongoDB use fsync()?</a> (the top answer is a bit of a goldmine for this subject in general, though some of the information regarding durability is out of date)</p> <p>Durability: The main way that users ensure data durability is by using the getLastError command (see link below for more info) to confirm that a majority of nodes in a replica set have written the data before the call returns.</p> <pre><code>http://www.mongodb.org/display/DOCS/getLastError+Command#getLastErrorCommand-majority http://docs.mongodb.org/manual/core/replication-internals/ (linked to in the above document) </code></pre> <p>Knowing all this about ACID in mongo, it would be very useful to look over some examples similar problems that have already been worked out in mongo. The two following links I expect will be really useful to you as they are very complete and right on subject.</p> <pre><code>Two-Phase Commits: http://cookbook.mongodb.org/patterns/perform-two-phase-commits/ Transactions for e-commerce work: http://www.slideshare.net/spf13/mongodb-ecommerce-and-transactions-10524960 </code></pre> <p>Finally, I have to ask: Why do you want to have transactions? It is rare that users of mongoDB find they truly need ACID to achieve their goals. It might be worthwhile stepping back and trying to approach the problem from another perspective before you go ahead and implement a whole layer on top of mongo just to get transactions.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload