ABOUT THIS BOOK xix
If you’ve already used MongoDB, then you may be more interested in particular
topics. Chapters 7–10 and all of the appendixes stand on their own and can safely be
read in any order. Additionally, chapters 4–6 contain the so-called “nuts and bolts” sec-
tions, which focus on fundamentals. These also can be read outside the flow of the
surrounding text.
Roadmap
This book is divided into three parts.
Part 1 is an end-to-end introduction to MongoDB. Chapter 1 gives an overview of
MongoDB’s history, features, and use cases. Chapter 2 teaches the database’s core con-
cepts through a tutorial on the MongoDB command shell. Chapter 3 walks through
the design of a simple application that uses MongoDB on the back end.
Part 2 is an elaboration of the MongoDB API presented in part 1. With a specific
focus on application development, the three chapters in part 2 progressively describe
a schema and its operations for an e-commerce app. Chapter 4 delves into documents,
the smallest unit of data in MongoDB, and puts forth a basic e-commerce schema
design. Chapters 5 and 6 then teach you how to work with this schema by covering
queries and updates. To augment the presentation, each of the chapters in part 2 con-
tains a detailed breakdown of its subject matter.
Part 3 focuses on performance and operations. Chapter 7 is a thorough study of
indexing and query optimization. Chapter 8 concentrates on replication, with strate-
gies for deploying MongoDB for high availability and read scaling. Chapter 9
describes sharding, MongoDB’s path to horizontal scalability. And chapter 10 provides
a series of best practices for deploying, administering, and troubleshooting MongoDB
installations.
The book ends with five appendixes. Appendix A covers installation of MongoDB
and Ruby (for the driver examples) on Linux, Mac OS X, and Windows. Appendix B
presents a series of schema and application design patterns, and it also includes a list
of anti-patterns. Appendix C shows how to work with binary data in MongoDB and
how to use GridFS, a spec implemented by all the drivers, to store especially large files
in the database. Appendix D is a comparative study of the PHP, Java, and C++ drivers.
Appendix E shows you how to use spatial indexing to query on geo-coordinates.
Code conventions and downloads
All source code in the listings and in the text is presented in a
fixed-width
font
,
which separates it from ordinary text.
Code annotations accompany some of the listings, highlighting important con-
cepts. In some cases, numbered bullets link to explanations that follow in the text.
As an open source project, 10gen keeps MongoDB’s bug tracker open to the com-
munity at large. At several points in the book, particularly in the footnotes, you’ll see
references to bug reports and planned improvements. For example, the ticket for
adding full-text search to the database is SERVER-380. To view the status of any such
Download from Wow! eBook <www.wowebook.com>