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?
Assuming that I have MongoDb installed in a server, and I am recording payments in a document. For instance:
{
UserId: "X-123456",
//Rest of user data,
Payments: [
{
TransactionId: "X-123456"
//Rest of payment data
}
]
}
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:
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
What happens to the data in this case? Will it be still available in the User document?