50 Tips and Tricks for MongoDB Developers

Overview

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 ...

See more details below
Paperback
$22.81
BN.com price
(Save 18%)$27.99 List Price
Other sellers (Paperback)
  • All (13) from $12.90   
  • New (9) from $15.42   
  • Used (4) from $12.9   
50 Tips and Tricks for MongoDB Developers

Available on NOOK devices and apps  
  • NOOK Devices
  • Samsung Galaxy Tab 4 NOOK
  • NOOK HD/HD+ Tablet
  • NOOK
  • NOOK Color
  • NOOK Tablet
  • Tablet/Phone
  • NOOK for Windows 8 Tablet
  • NOOK for iOS
  • NOOK for Android
  • NOOK Kids for iPad
  • PC/Mac
  • NOOK for Windows 8
  • NOOK for PC
  • NOOK for Mac
  • NOOK for Web

Want a NOOK? Explore Now

NOOK Book (eBook)
$10.49
BN.com price
(Save 38%)$16.99 List Price

Overview

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
Read More Show Less

Product Details

  • ISBN-13: 9781449304614
  • Publisher: O'Reilly Media, Incorporated
  • Publication date: 5/6/2011
  • Edition number: 1
  • Pages: 68
  • Product dimensions: 6.90 (w) x 9.00 (h) x 0.30 (d)

Meet the Author

Kristina Chodorow, a software engineer at 10gen, is a core contributor to the MongoDB project and has worked on the database server, PHP driver, Perl driver, and many other areas. She’s given talks at conferences around the world, including OSCON, LinuxCon, FOSDEM, and Latinoware.

Read More Show Less

Table of Contents

Preface;
Who This Book Is For;
Conventions Used in This Book;
Using Code Examples;
Safari® Books Online;
How to Contact Us;
Chapter 1: Application Design Tips;
1.1 Tip #1: Duplicate data for speed, reference data for integrity;
1.2 Tip #2: Normalize if you need to future-proof data;
1.3 Tip #3: Try to fetch data in a single query;
1.4 Tip #4: Embed dependent fields;
1.5 Tip #5: Embed “point-in-time” data;
1.6 Tip #6: Do not embed fields that have unbound growth;
1.7 Tip #7: Pre-populate anything you can;
1.8 Tip #8: Preallocate space, whenever possible;
1.9 Tip #9: Store embedded information in arrays for anonymous access;
1.10 Tip #10: Design documents to be self-sufficient;
1.11 Tip #11: Prefer $-operators to JavaScript;
1.12 Tip #12: Compute aggregations as you go;
1.13 Tip #13: Write code to handle data integrity issues;
Chapter 2: Implementation Tips;
2.1 Tip #14: Use the correct types;
2.2 Tip #15: Override _id when you have your own simple, unique id;
2.3 Tip #16: Avoid using a document for _id;
2.4 Tip #17: Do not use database references;
2.5 Tip #18: Don’t use GridFS for small binary data;
2.6 Tip #19: Handle “seamless” failover;
2.7 Tip #20: Handle replica set failure and failover;
Chapter 3: Optimization Tips;
3.1 Tip #21: Minimize disk access;
3.2 Tip #22: Use indexes to do more with less memory;
3.3 Tip #23: Don’t always use an index;
3.4 Tip #24: Create indexes that cover your queries;
3.5 Tip #25: Use compound indexes to make multiple queries fast;
3.6 Tip #26: Create hierarchical documents for faster scans;
3.7 Tip #27: AND-queries should match as little as possible as fast as possible;
3.8 Tip #28: OR-queries should match as much as possible as soon as possible;
Chapter 4: Data Safety and Consistency;
4.1 Tip #29: Write to the journal for single server, replicas for multiserver;
4.2 Tip #30: Always use replication, journaling, or both;
4.3 Tip #31: Do not depend on repair to recover data;
4.4 Tip #32: Understand getlasterror;
4.5 Tip #33: Always use safe writes in development;
4.6 Tip #34: Use w with replication;
4.7 Tip #35: Always use wtimeout with w;
4.8 Tip #36: Don’t use fsync on every write;
4.9 Tip #37: Start up normally after a crash;
4.10 Tip #38: Take instant-in-time backups of durable servers;
Chapter 5: Administration Tips;
5.1 Tip #39: Manually clean up your chunks collections;
5.2 Tip #40: Compact databases with repair;
5.3 Tip #41: Don’t change the number of votes for members of a replica set;
5.4 Tip #42: Replica sets can be reconfigured without a master up;
5.5 Tip #43: —shardsvr and —configsvr aren’t required;
5.6 Tip #44: Only use —notablescan in development;
5.7 Tip #45: Learn some JavaScript;
5.8 Tip #46: Manage all of your servers and databases from one shell;
5.9 Tip #47: Get “help” for any function;
5.10 Tip #48: Create startup files;
5.11 Tip #49: Add your own functions;
5.12 Tip #50: Use a single connection to read your own writes;

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)