documents. All documents in MongoDB must be less than 16MB, which is the BSON document size . 

All documents are part of a collection , which are a logical groupings of documents in a MongoDB database. The documents in a collection share a set of indexes, and typically these documents share common fields and structure. 

In MongoDB the database construct is a group of related collections. Each database has a distinct set of data files and can contain a large number of collections. A single MongoDB deployment may have many databases. 

## WiredTiger Storage Engine 

New in version 3.0. 

WiredTiger is a storage engine that is optionally available in the 64-bit build of MongoDB 3.0. It excels at read and insert workloads as well as more complex update workloads. 

Document Level Locking With WiredTiger, all write operations happen within the context of a document level lock. As a result, multiple clients can modify more than one document in a single collection at the same time. With this very granular concurrency control, MongoDB can more effectively support workloads with read, write and updates as well as high-throughput concurrent workloads. 

Journal WiredTiger uses a write-ahead transaction log in combination with checkpoints to ensure data persistence. With WiredTiger, MongoDB will commit a checkpoint to disk every 60 seconds or when there are 2 gigabytes of data to write. Between and during checkpoints the data files are always valid. 

The WiredTiger journal persists all data modifications between checkpoints. If MongoDB exits between checkpoints, it uses the journal to replay all data modified since the last checkpoint. By default, the 

WiredTiger journal is compressed using the snappy compression library. To specify an alternate compression algorithm or no compression, use the storage.wiredTiger.engineConfig.journalCompressor setting. 

You can disable journaling by setting storage.journal.enabled to false , which can reduce the overhead of maintaining the journal. For standalone instances, not using the journal means that you will lose some data modifica- tions when MongoDB exits unexpectedly between checkpoints. For members of replica sets , the replication process may provide sufficient durability guarantees. 

Compression With WiredTiger, MongoDB supports compression for all collections and indexes. Compression min- imizes storage use at the expense of additional CPU. 

By default, WiredTiger uses block compression with the snappy compression library for all collections and prefix compression for all indexes. 

For collections, block compression with zlib is also available. To specify an alternate compression algorithm or no compression, use the storage.wiredTiger.collectionConfig.blockCompressor setting. 

For indexes, to disable prefix compression , use the storage.wiredTiger.indexConfig.prefixCompression setting. 

Compression settings are also configurable on a per-collection and per-index basis during collection and index creation. See create-collection-storage-engine-options and db.collection.createIndex() storageEngine option . 

For most workloads, the default compression settings balance storage efficiency and processing requirements. 

The WiredTiger journal is also compressed by default. For information on journal compression, see Journal (page 90). 

## See also: 

http://wiredtiger.com 

