'How to have a sequence status in NoSQL without transaction

This question is only for understanding purpose. This might be a noob question.

Assume that I have a tabular or document NoSQL database which do not support transactions. And I have an orders table/collection which has a status column. Initially the status will be DRAFTED. My objective is to create an invoice, store it in another table invoices and update my orders table status to INVOICE_CREATED. Assume that I cannot store the invoice in my orders table itself(denormalize) due to some reason (large size could be a reason).

How do I handle this logic without a transaction in a NoSQL? Do I need to model my tables in some other way?

Let's assume that:

  1. Invoice creation does not have any third party dependency. It is done inside the system itself.
  2. I cannot use an SQL
  3. I should not use transaction support provided by DBs like Mongo

NOTE: These might be a lot of assumptions and might not be real-world use cases. But I am just trying to understand HOW we should model NoSQL databases.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source