Skip to main content
Top

2015 | Book

The Definitive Guide to MongoDB

A complete guide to dealing with Big Data using MongoDB

Authors: David Hows, Peter Membrey, Eelco Plugge, Tim Hawkins

Publisher: Apress

insite
SEARCH

About this book

The Definitive Guide to MongoDB, Third Edition, is updated for MongoDB 3 and includes all of the latest MongoDB features, including the aggregation framework introduced in version 2.2 and hashed indexes in version 2.4. The Third Edition also now includes Node.js along with Python.

MongoDB is the most popular of the "Big Data" NoSQL database technologies, and it's still growing. David Hows from 10gen, along with experienced MongoDB authors Peter Membrey and Eelco Plugge, provide their expertise and experience in teaching you everything you need to know to become a MongoDB pro.

Table of Contents

Frontmatter
Chapter 1. Introduction to MongoDB
Abstract
Imagine a world where using a database is so simple that you soon forget you’re even using it. Imagine a world where speed and scalability just work, and there’s no need for complicated configuration or set up. Imagine being able to focus only on the task at hand, get things done, and then—just for a change—leave work on time. That might sound a bit fanciful, but MongoDB promises to help you accomplish all these things (and more).
David Hows, Peter Membrey, Eelco Plugge, Tim Hawkins
Chapter 2. Installing MongoDB
Abstract
In Chapter 1, you got a taste of what MongoDB can do for you. In this chapter, you will learn how to install and expand MongoDB to do even more, enabling you to use it in combination with your favorite programming language.
David Hows, Peter Membrey, Eelco Plugge, Tim Hawkins
Chapter 3. The Data Model
Abstract
In Chapter 2, you learned how to install MongoDB on two commonly used platforms (Windows and Linux), as well as how to extend the database with some additional drivers. In this chapter, you will shift your attention from the operating system and instead examine the general design of a MongoDB database. Specifically, you’ll learn what collections are, what documents look like, how indexes work and what they do, and finally, when and where to reference data instead of embedding it. We touched on some of these concepts briefly in Chapter 1, but in this chapter, we’ll explore them in more detail. Throughout this chapter, you will see code examples designed to give you a good feeling for the concepts being discussed. Do not worry too much about the commands you’ll be looking at, however, because they will be discussed extensively in Chapter 4.
David Hows, Peter Membrey, Eelco Plugge, Tim Hawkins
Chapter 4. Working with Data
Abstract
In Chapter 3, you learned how the database works on the backend, what indexes are, how to use a database to quickly find the data you are looking for, and what the structure of a document looks like. You also saw a brief example that illustrated how to add data and find it again using the MongoDB shell. In this chapter, we will focus more on working with data from your shell.
David Hows, Peter Membrey, Eelco Plugge, Tim Hawkins
Chapter 5. GridFS
Abstract
We live in a world of high-definition video, 12MP cameras, and storage media that can hold 50GB of data on a disc the size of a CD-ROM. In that context, the 16MB limit for the maximum size of a MongoDB document might seem laughably inadequate. Indeed, you might wonder why MongoDB, which has been designed as a database for today’s high-tech age, has such a seemingly strange limitation. The short answer is performance.
David Hows, Peter Membrey, Eelco Plugge, Tim Hawkins
Chapter 6. PHP and MongoDB
Abstract
Through Chapters 1 to 5, you’ve learned how to perform all sorts of actions in the MongoDB shell. For example, you’ve learned how to add, modify, and delete a document. You’ve also learned about the workings of DBRef and GridFS, including how to use them.
David Hows, Peter Membrey, Eelco Plugge, Tim Hawkins
Chapter 7. Python and MongoDB
Abstract
Python is one of the easier programming languages to learn and master. It’s an especially great language to start with if you are relatively new to programming. And you’ll pick it up that much more quickly if you’re already quite familiar with programming.
David Hows, Peter Membrey, Eelco Plugge, Tim Hawkins
Chapter 8. Advanced Queries
Abstract
The chapters so far have covered most of the basic query mechanisms to find one or a series of documents by given criteria. There are a number of mechanisms for finding given documents to bring them back to your application so they can be processed. But sometimes these normal query mechanisms fall short, and you might need to perform complex operations over most or all of the documents in your collection. When queries or operations of this kind are required, many developers either iterate through all documents in the collection or write a series of queries to be executed in sequence to perform the necessary calculations. Although this is a valid way of doing things, it can be burdensome to write and maintain, as well as inefficient. It is for these reasons that MongoDB has some advanced query mechanics that you can use to derive the most from your data. The advanced MongoDB features we’ll examine in this chapter are full-text search, the aggregation framework, and the MapReduce framework.
David Hows, Peter Membrey, Eelco Plugge, Tim Hawkins
Chapter 9. Database Administration
Abstract
In this chapter, we will walk you through some of the basic administrative operations you can perform on a MongoDB server. We will also show how to automate some of those activities, such as backing up your server.
David Hows, Peter Membrey, Eelco Plugge, Tim Hawkins
Chapter 10. Optimization
Abstract
There is a tongue-in-cheek statement attributed to an unknown Twitter user: “If a MongoDB query runs for longer than 0ms, then something is wrong.” This is typical of the kind of buzz that surrounded the product when it first burst onto the scene in 2009.
David Hows, Peter Membrey, Eelco Plugge, Tim Hawkins
Chapter 11. Replication
Abstract
Like many of its relational cousins, MongoDB supports the replication of a database’s contents to another server in real time or near real time. MongoDB’s replication features are simple to set up and use. They are also among the key features in MongoDB that, along with sharding, bolster the claim that the database is both a web 2.0 and a cloud-based data store.
David Hows, Peter Membrey, Eelco Plugge, Tim Hawkins
Chapter 12. Sharding
Abstract
Whether you’re building the next Facebook or just a simple database application, you will probably need to scale your app up at some point if it’s successful. If you don’t want to be continually replacing your hardware (or you begin approaching the limits of what you can do on just one piece of hardware), then you will want to use a technique that allows you to add capacity incrementally to your system, as you need it. Sharding is a technique that allows you to spread your data across multiple machines, yet does so in a way that mimics an app hitting a single database.
David Hows, Peter Membrey, Eelco Plugge, Tim Hawkins
Backmatter
Metadata
Title
The Definitive Guide to MongoDB
Authors
David Hows
Peter Membrey
Eelco Plugge
Tim Hawkins
Copyright Year
2015
Publisher
Apress
Electronic ISBN
978-1-4842-1182-3
Print ISBN
978-1-4842-1183-0
DOI
https://doi.org/10.1007/978-1-4842-1182-3

Premium Partner