MongoDB作為一套高性能、特性豐富的NoSQL數(shù)據(jù)庫,構(gòu)成了眾多復(fù)雜的研發(fā)系統(tǒng)的支柱。在本書中,你肯定能夠找到你正在苦苦找尋的MongoDB解決方案。從如何使用各種配置在不同的模式下初始化服務(wù)器開始,你將學(xué)到包括高級查詢、MongoDB特性以及利用MMS進(jìn)行監(jiān)控和備份在內(nèi)的諸多技巧。隨后接著深入探究云端部署、Hadoop集成、提升開發(fā)人員生產(chǎn)力。
Preface
Chapter 1 Installin and Starting the MongoDB Server
Introduction
Single node Installation of MongoDB
Starting a single node instance using command-line options
Single node installation of MongoDB with options from the config file
Connecting to a single node from the Mongo shell with a
preloaded JavaScript
Connecting to a single node from a Java client
Starting multiple instances as part of a replica set
Connecting to the replica set from the shell to query and insert data
Connecting to the replica set to query and insert data from a Java client
Starting a simple sharded environment of two shards
Connecting to a shard from the Mongo shell and performing operations
Chapter 2: Command-line Operations and Indexes
Creating test data
Performing simple querying, projections, and pagination
from the Mongo shell
Updating and deleting data from the shell
Creating an Index and viewing plans of queries
Background and foreground index creation from the shell
Creating unique indexes on collection and deleting the
existing duplicate data automatically
Creating and understanding sparse indexes
Expiring documents after a fixed interval using the TrL index
Expiring documents at a given time using the TrL index
Chapter 3: Programming Language Drivers
Introduction
Installing PyMongo
Executing query and insert operations using PyMongo
Executing update and delete operations using PyMongo
Aggregation in Mongo using PyMongo
MapReduce in Mongo using PyMongo
Executing query and insert operations using a Java client
Executing update and delete operations using a Java client
Aggregation in Mongo using a Java client
MapReduce in Mongo using a Java client
Chapter 4: Administration
Renaming a collection
Viewing collection stats
Viewing database stats
Disabling the preallocation of data files
Manually padding a document
Understanding the mongostat and mongotop utilities
Estimating the working set
Viewing and killing the currently executing operations
Using profiler to profile operations
Setting up users in MongoDB
Understanding interprocess security in MongoDB
Modifying collection behavior using the collMod command
Setting up MongoDB as a Windows Service
Configuring a replica set
Stepping down as a primary instance from the replica set
Exploring the local database of a replica set
Understanding and analyzing oplogs
Building tagged replica sets
Configuring the default shard for nonsharded collections
Manually splitting and migrating chunks
Performing domain-driven sharding using tags
Exploring the config database in a sharded setup
Chapter 5: Advanced Operations
Introduction
Atomic find and modify operations
Implementing atmic counters in MongoDB
Implementing server-side scripts
Creating and tailing capped collection cursors in MongoDB
Converting a normal collection to a capped collection
Storing binary data in MongoDB
Storing large data in MongoDB using GridFS
Storing data to GridFS from a Java client
Storing data to GridFS from a Python client
Implementing triggers in MongoDB using oplog
Executing flat plane (2D) geospatial queries in Mongo using
geospatial indexes
Spherical indexes and GeoJSON-compliant data in MongoDB
Implementing a full-text search in MongoDB
Integrating MongoDB with Elasticsearch for a full-text search
Chapter 6: Monitoring and Backups
Introduction
Signing up for MMS and setting up the MMS monitoring agent
Managing users and groups on the MMS console
Monitoring MongoDB instances on MMS
Setting up monitoring alerts on MMS
Backing up and restoring data in Mongo using out-of-the box tools
Configuring the MMS backup service
Managing backups in the MMS backup service
Chapter 7: Cloud Deployment on MongoDB
Introduction
Setting up and managing the MongoLab account
Setting up a sandbox MongoDB instance on MongoLab
Performing operations on MongoDB from MongoLab GUI
Setting up MongoDB on Amazon EC2 using the MongoDB AMI
Setting up MongoDB on Amazon EC2 without using the MongoDB AMI
Chapter 8: Integration with Hadoop
Introduction
Executing our first sample MapReduce job using the
mongo-hadoop connector
Writing our first Hadoop MapReduce job
Running MapReduce jobs on Hadoop using streaming
Running a MapReduce job on Amazon EMR
Chapter 9: Open Source and Progrietary Tools
Introduction
Developing using spring-data-mongodb
Accessing MongoDB using Java Persistence API
Accessing MongoDB over REST
Installing the GUI-based client, MongoVUE, for MongoDB
Appendix: Concepts for Reference
Write concern and its significance
Read preference for querying
Index