Data Loss If Journaling is Not Happening

Data Loss Scenario

Remote Commit without Journaling

This example illustrates how data would be lost if journaling was not happening in NuoDB.

Two inserts are made to foo. One will be persisted to the archive before the SM goes offline, the other will not. The TE sends a pre-commit message for each transaction to the SM and waits for an ACK message in return. The SM acknowledges the pre-commit message back to the TE as soon as it hits memory. Once in memory, the transaction is queued to be written to the archive.

The first transaction, foo.1, is written to the archive. The second transaction, foo.2, dies in the archive queue when the SM goes down.

SM Restart and Query (Still no Journal)

The foo.2 transaction existed online in memory even though the transaction was acknowledged as committed. When the SM died before it could write the transaction to disk, the data was lost. The diagram below illustrates the data loss after the SM is brought back online. The client had performed two inserts previously, but only one is returned when the database is queried.