MongoDatabases

The database handle every store of Wow reads and writes through: each write acknowledged by a majority of the replica set (w: majority) and each read sent to the primary, both set on the handle so that a client whose default is w: 1 or a secondary read preference cannot weaken them, and each call bounded by its store's timeout (MongoTimeouts). A write the primary acknowledged alone is lost when the primary fails over before it replicates: a reservation (a uniqueness broken), a timer (a command never sent), a checkpoint, a lease, a ledger entry. Snapshots are derivable from the log, but take majority too: one rule for every collection is simpler than an exception that has to stay true. A read from a secondary lags: a state load would read an older version and fail its append as a conflict, and a log, checkpoint, lease or timer read would read behind what this node wrote. The queries' storages take their own read preference (query-read-preference).

Functions

Link copied to clipboard
fun of(client: MongoClient, name: String, timeout: Duration = MongoTimeouts.OPERATION): MongoDatabase

name on client as Wow's stores use it: majority writes, primary reads, each call bounded by timeout.