Avoids a race condition when multiple server instances are backed by the MongoDB database. MongoDB does not have transactions, atomic upserts are used instead.