MongoDB is schema-flexible, not schema-less, and good schema design is critical for performance and maintainability. Key do's include modeling around access patterns (not entities), using the Extended Reference Pattern to avoid joins, the Pre-Compute Pattern for expensive aggregations (reducing latency from 3s to 80ms in a real example), the Polymorphic Pattern for flexible document types, the Bucket Pattern for time-series data, and versioning schemas as they evolve. Key don'ts include letting arrays grow unbounded, over-normalizing data with excessive $lookup joins, and over-indexing. The core principle: design your schema around how your application reads and writes data, not around relational table structures.

Sort: