The first Mongo Days conference I attended was MongoSV 2011. I chose to attend "Schema Design at Scale", a presentation by Eliot Horowitz. The first slide was titled "Schema", and had a list of reasons to know MongoDB schema best practices:
Schema is the...
- Single biggest performance factor
- More choices than in an RDBMS
- Embedding, index design, shard keys
Eliot accompanied the slide by saying:
Schema design is ... the largest factor when it comes to performance and scalability ... more important than hardware, how you shard, or anything else, schema is by far the most important thing.
The presentation walks through things to consider when designing your schema. For anyone new to Mongo or hitting performance issues, please watch the presentation, it will improve your experience with Mongo.
The main topics are...
02:13 – Embedding documents: how to think about embedding documents 10:00 – Index design Overview 11:00 – Right Balanced Indexes: limit the required RAM by optimizing your indexes 13:18 – Covered Indexes: include fields in index to the requested fields, and only hit indexes 15:44 – Sharding: "at some point you are going to have to scale, and that means sharding" 17:25 – Shard key: "choosing a shard key is easy in the beginning, but hard to change later." 21:27 – Justin Bieber tweet reference
Watch the full presentation
MongoDB Performance Toolset
At MongoHQ, we take performance seriously, and have built an amazing stack of optimizing your database's performance:
- Slow Query Tracker & Profiler
- New Relic Integration
- Customer Centric Alerts with PagerDuty Integration
- Real-Time Performance Dashboard Create an account with us to get started with a MongoDB hosting equipped with the tools you need to succeed.