Getting started with MongoDB is easy, but once you begin building applications with it, you'll face some complex issues. What are the tradeoffs between normalized and denormalized data? How do you handle replica set failure and failover? This collection of MongoDB tips, tricks, and hacks helps you r
50 Tips and Tricks for MongoDB Developers
β Scribed by Kristina Chodorow
- Publisher
- O'Reilly Media
- Year
- 2011
- Tongue
- English
- Leaves
- 66
- Edition
- 1
- Category
- Library
No coin nor oath required. For personal study only.
β¦ Synopsis
Getting started with MongoDB is easy, but once you begin building applications with it, you'll face some complex issues. What are the tradeoffs between normalized and denormalized data? How do you handle replica set failure and failover? This collection of MongoDB tips, tricks, and hacks helps you resolve issues with everything from application design and implementation to data safety and monitoring. You get specific guidance in five topic areas directly from engineers at 10gen, the company that develops and supports this open source database:Application Design Tips: What to keep in mind when designing your schema Implementation Tips: Programming applications against MongoDB Optimization Tips: Speeding up your applications Data Safety Tips: Using replication and journaling to keep data safeβwithout sacrificing too much performance Administration Tips: How to configure MongoDB and keep it running smoothly
β¦ Table of Contents
Copyright......Page 8
Table of Contents......Page 9
Who This Book Is For......Page 11
Using Code Examples......Page 12
How to Contact Us......Page 13
Tip #1: Duplicate data for speed, reference data for integrity......Page 15
Example: a shopping cart order......Page 16
Decision factors......Page 18
Example: a blog......Page 19
Example: an image board......Page 20
Tip #6: Do not embed fields that have unbound growth......Page 21
Tip #7: Pre-populate anything you can......Page 22
Tip #9: Store embedded information in arrays for anonymous access......Page 23
Tip #10: Design documents to be self-sufficient......Page 26
Tip #11: Prefer $-operators to JavaScript......Page 27
Getting better performance......Page 28
Tip #13: Write code to handle data integrity issues......Page 29
Tip #14: Use the correct types......Page 31
Tip #16: Avoid using a document for _id......Page 32
Tip #18: Donβt use GridFS for small binary data......Page 33
Tip #19: Handle βseamlessβ failover......Page 34
Tip #20: Handle replica set failure and failover......Page 35
Fuzzy Math......Page 37
Tip #22: Use indexes to do more with less memory......Page 38
Tip #23: Donβt always use an index......Page 40
Tip #24: Create indexes that cover your queries......Page 41
Tip #25: Use compound indexes to make multiple queries fast......Page 42
Tip #26: Create hierarchical documents for faster scans......Page 43
Tip #27: AND-queries should match as little as possible as fast as possible......Page 44
Tip #28: OR-queries should match as much as possible as soon as possible......Page 45
Tip #29: Write to the journal for single server, replicas for multiserver......Page 47
Tip #30: Always use replication, journaling, or both......Page 48
Tip #31: Do not depend on repair to recover data......Page 49
Tip #34: Use w with replication......Page 50
Tip #35: Always use wtimeout with w......Page 51
Tip #36: Donβt use fsync on every write......Page 52
Tip #38: Take instant-in-time backups of durable servers......Page 53
Tip #40: Compact databases with repair......Page 55
Tip #42: Replica sets can be reconfigured without a master up......Page 57
Tip #43: --shardsvr and --configsvr arenβt required......Page 59
Tip #46: Manage all of your servers and databases from one shell......Page 60
Tip #47: Get βhelpβ for any function......Page 61
Tip #49: Add your own functions......Page 63
Loading JavaScript from files......Page 64
Tip #50: Use a single connection to read your own writes......Page 65
π SIMILAR VOLUMES
Getting started with MongoDB is easy, but once you begin building applications with it, you'll face some complex issues. What are the tradeoffs between normalized and denormalized data? How do you handle replica set failure and failover? This collection of MongoDB tips, tricks, and hacks helps you r
Getting started with MongoDB is easy, but youll face some complex issues once you begin building applications with it. This collection of MongoDB tips, tricks, and hacks helps you resolve issues with everything from application design and implementation to data safety and monitoring. You get pinpoin
Getting started with MongoDB is easy, but once you begin building applications with it, you'll face some complex issues. What are the tradeoffs between normalized and denormalized data? How do you handle replica set failure and failover? This collection of MongoDB tips, tricks, and hacks helps you r
<p>Getting started with MongoDB is easy, but you'll face some complex issues once you begin building applications with it. This collection of MongoDB tips, tricks, and hacks helps you resolve issues with everything from application design and implementation to data safety and monitoring. You get pin
Annotation