Learning paths · Skills · Intermediate

MongoDB: documents, and the trade-offs they bring

How to shape documents around the way you read them, which index serves which query, what a write acknowledgement really promises, how a replica set fails over, and what changes when you add transactions, shards and change streams.

0 of 12 done

The map

  • Not started
  • In progress
  • Done
  1. 01Documents and schemasShape data by how you read it0/3
  2. 02Finding things fastPlans, indexes, pipelines0/3
  3. 03Writes you can trustReplicas, acknowledgements, transactions0/3
  4. 04Scale and changeShards, streams, storage0/3
  5. 05Next: system designSame ideas, at service scale

Written for MongoDB 7.0 and 8.x; the links point to the current manual. The examples were run on MongoDB 8.3.13 with mongosh 2.13.0, on a three-member replica set in Docker with 200,000 synthetic orders, so counts and timings will differ on your machine. Sharding examples were not run. MongoDB 9.0 was released in September 2026; where it changes something covered here, the topic says so.

On licensing: MongoDB Community Server versions released on or after 16 October 2018 are under the Server Side Public License (SSPL), a licence written by MongoDB Inc. and based on the GPLv3. It is not approved by the Open Source Initiative, which is why MongoDB is usually described as source-available rather than open source. Its extra copyleft condition (section 13) applies when you offer MongoDB's own functionality to third parties as a service; MongoDB's FAQ says other applications that merely use MongoDB, including SaaS products, are not subject to it. Earlier versions remain under the AGPLv3, and the official drivers are Apache 2.0. If licensing matters for your use, read the licence and its FAQ rather than a summary.

Where this path leads