Today's reading of MongoDB

something about,
embedded documents
atomicity and transaction
$isolated operator

two-phase commit

only transaction-like for multiple document
multi-document transaction, rollback-like functionality, not really an all or nothing transaction

  • atomicity, rollback previous state
  • consistency, consistent state recovery
    intermediate data presentation

concurrency control : two approach, unique index, update if current

Update if current pattern

an approach to currency control for multiple clients operate the same data

version pattern

variant : version pattern , similar to Update if current pattern
to add an version field to document schema, application/client need increment the version field upon each update operation to a specific document.
version field can be set 1 as default value for a document creation / insert operation.

it need ensure client application query data including the version field.

version can be implemented by “auto-incrementing sequence” field

SQL2Mongo

SQL2Mongo : tool to migrate all schema and data from MSSQL to mongodb,