MongoDB

Раздел про MongoDB: ACID и уровни согласованности (read/write concerns, транзакции, causal consistency), репликация и шардинг (replica set, sharded cluster, shard key), документное моделирование (embed vs reference, индексы). Объяснения с примерами на двух коллекциях category и product.

Why it matters for UCP. MongoDB is used in UCP services with a document-shaped data nature (profiles, catalogs with dynamic attributes, event logs). A senior engineer should be able to choose deliberately between PG and Mongo. Part of the learning program.

Articles on how MongoDB is built and operated. The examples use the same two collections as the PostgreSQL section (category + product), so it's easy to compare the relational and document approaches.

Articles in this section

  1. ACID, read and write concerns, transactions — what MongoDB guarantees and what it doesn't, the five read concern levels, write concern by number of replicas, multi-document transactions (since 4.0), causal consistency.
  2. Replication and sharding — replica set, oplog, primary election, read preference, sharded cluster (mongos / config servers / shards), shard key strategies (ranged / hashed / zoned), how to estimate database size.
  3. Document modeling: embed vs reference, indexes — when to embed, when to reference, the one-to-few / one-to-many / one-to-millions rule, array antipatterns, schema validation, index types.