🍃

MongoDB

Document model, CRUD & aggregation, indexing, replica sets & sharding, multi-document transactions, schema design, performance, and Spring Data MongoDB.

1

MongoDB — Documents, CRUD & the Aggregation Framework

beginner

Every MongoDB skill covered here — indexing, transactions, schema design, Spring Data — sits on top of one idea: a document is not a row. This chapter builds that idea from scratch, then takes you through CRUD and your first real, multi-stage aggregation pipeline.

2

MongoDB — Indexing, Replica Sets & Sharding

intermediate

A query without the right index doesn't error — it just quietly scans your whole collection until the collection is too big for that to stay quiet. This chapter is about catching that before production does, plus the two mechanisms — replica sets and sharding — that let one MongoDB deployment become many machines pretending to be one.

3

MongoDB Transactions — Single & Multi-Document ACID

intermediate

Transaction Mastery, Chapter 14 already covered the mechanics — sessions, replica-set requirement, read/write concern. This chapter covers the angle that's genuinely MongoDB-specific: how schema design decides how often you need a transaction at all.

4

MongoDB Schema Design — Embedding vs. Referencing

advanced

There's no ALTER TABLE debate in MongoDB — there's exactly one recurring design decision, made once per relationship, that determines whether your app stays fast and simple or turns slow and tangled. This chapter is that one decision, made rigorously.

5

MongoDB Performance — Explain Plans, Covered Queries & Pagination

advanced

A dashboard that's fast in a demo and slow at page 500 isn't a different bug from a query with no index — both come from the same instinct to skip past work instead of seeking directly to it. This chapter covers reading explain() as a real debugging tool, reaching the fully index-only covered-query state, and fixing pagination that gets slower the deeper a user scrolls.

6

Spring Boot with MongoDB — Spring Data MongoDB & MongoRepository

advanced

The same @Transactional, the same repository pattern, the same derived-query-method naming convention as Spring Data JPA — but every one of them compiles down to a BSON document and a Mongo query underneath, not SQL. This chapter is that mapping, made concrete.