### Documentation
- Call me maybe: MongoDB
- MongoDB schema design pitfalls
- Analyze Performance of Database Operations enable with
db.setProfilingLevel(2)
and query withdb.system.profile.find( { millis : { $gt : 5 } } ).pretty()
for instance;show profile
displays the five most recent events that took more than 1ms - Measuring time and analyzing a query: explain()
db.collection.find().explain().millis
gives the time taken by a given query - Ways to implement data versioning in MongoDB StackOverflow
- Atomic Counters using MongoDB’s findAndModify with PHP
- How to apply automatic versioning to a C# class
- Data Models
- Use Case: Metadata and Asset Management describes the design and pattern of a content management system using MongoDB modeled on the popular Drupal CMS
- Use Case: Storing comments utlines the basic patterns for storing user-submitted comments in a content management system (CMS).
- Use Case: Storing Log Data outlines the basic patterns and principles for using MongoDB as a persistent storage engine for log data from servers and other machine data
- Use Case: Pre-Aggregated Reports outlines the basic patterns and principles for using MongoDB as an engine for collecting and processing events in real time for use in generating up to the minute or second reports
### Some basic facts
- Schema-less
- Collections of Documents
- A single JavaScript call will retrieve a document and all of its nested content; getting into nested content involves further operations
- JSON output (data stored as BSON)
- Object IDs: always 12 bytes, composed of a timestamp, client machine ID, client process ID, and a 3-byte incremented counter; this autonumbering scheme makes that each process on every machine can handle its own ID generation without colliding with other mongod instances (source: «7 databases in 7 weeks», p.138)
- Javascript for queries and manipulation
- No server-side joins
- Map-reduce queries