50 Tips and Tricks for MongoDB Developers [NOOK Book]

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

See more details below
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: 9781449308674
  • Publisher: O'Reilly Media, Incorporated
  • Publication date: 4/19/2011
  • Sold by: Barnes & Noble
  • Format: eBook
  • Edition number: 1
  • Pages: 68
  • Sales rank: 764,067
  • File size: 4 MB

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)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

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