title: Mongodb and persistent data
body: <p>With respect to the fact that Mongo is a NoSql database and taking account of the heavy reliance of NoSql Dbs on RAM, I have been wondering what would happen in the following scenario? </p>
  
  <p>Assuming that I have MongoDb installed in a server, and I am recording payments in a document. For instance: </p>
  
  <pre><code> {
       UserId: "X-123456",
       //Rest of user data,
       Payments: [
          {
              TransactionId: "X-123456"
              //Rest of payment data
          }
       ]
   }
  </code></pre>
  
  <p>When a user makes a payment, and the server receives the successful payment response, in about a few seconds after the response has been added to the document, the power goes out and the server shuts down. For instance:</p>
  
  <pre><code> 1- Response received at 04.01.01.100
   2- Response added to Mongo Document at 04.01.01.300
   3- Power goes out at 04.01.05.00
  </code></pre>
  
  <p>What happens to the data in this case? Will it be still available in the <code>User</code> document?  </p>