MongoDB: The Definitive Guide. Powerful and Scalable Data Storage. 3rd Edition - Helion
ISBN: 978-14-919-5441-6
stron: 514, Format: ebook
Data wydania: 2019-12-09
Księgarnia: Helion
Cena książki: 194,65 zł (poprzednio: 226,34 zł)
Oszczędzasz: 14% (-31,69 zł)
Manage your data with a system designed to support modern application development. Updated for MongoDB 4.2, the third edition of this authoritative and accessible guide shows you the advantages of using document-oriented databases. You’ll learn how this secure, high-performance system enables flexible data models, high availability, and horizontal scalability.
Authors Shannon Bradshaw, Eoin Brazil, and Kristina Chodorow provide guidance for database developers, advanced configuration for system administrators, and use cases for a variety of projects. NoSQL newcomers and experienced MongoDB users will find updates on querying, indexing, aggregation, transactions, replica sets, ops management, sharding and data administration, durability, monitoring, and security.
In six parts, this book shows you how to:
- Work with MongoDB, perform write operations, find documents, and create complex queries
- Index collections, aggregate data, and use transactions for your application
- Configure a local replica set and learn how replication interacts with your application
- Set up cluster components and choose a shard key for a variety of applications
- Explore aspects of application administration and configure authentication and authorization
- Use stats when monitoring, back up and restore deployments, and use system settings when deploying MongoDB
Osoby które kupowały "MongoDB: The Definitive Guide. Powerful and Scalable Data Storage. 3rd Edition", wybierały także:
- Windows Media Center. Domowe centrum rozrywki 66,67 zł, (8,00 zł -88%)
- Przywództwo w świecie VUCA. Jak być skutecznym liderem w niepewnym środowisku 58,64 zł, (12,90 zł -78%)
- Mapa Agile & Scrum. Jak si 57,69 zł, (15,00 zł -74%)
- Sztuka podst 53,46 zł, (13,90 zł -74%)
- Lean dla bystrzaków. Wydanie II 49,62 zł, (12,90 zł -74%)
Spis treści
MongoDB: The Definitive Guide. Powerful and Scalable Data Storage. 3rd Edition eBook -- spis treści
- Preface
- How This Book Is Organized
- Getting Started with MongoDB
- Developing with MongoDB
- Replication
- Sharding
- Application Administration
- Server Administration
- Appendixes
- Conventions Used in This Book
- Using Code Examples
- OReilly Online Learning
- How to Contact Us
- How This Book Is Organized
- I. Introduction to MongoDB
- 1. Introduction
- Ease of Use
- Designed to Scale
- Rich with Features
- Without Sacrificing Speed
- The Philosophy
- 2. Getting Started
- Documents
- Collections
- Dynamic Schemas
- Naming
- Subcollections
- Databases
- Getting and Starting MongoDB
- Introduction to the MongoDB Shell
- Running the Shell
- A MongoDB Client
- Basic Operations with the Shell
- Create
- Read
- Update
- Delete
- Data Types
- Basic Data Types
- Dates
- Arrays
- Embedded Documents
- _id and ObjectIds
- ObjectIds
- Autogeneration of _id
- Using the MongoDB Shell
- Tips for Using the Shell
- Running Scripts with the Shell
- Creating a .mongorc.js
- Customizing Your Prompt
- Editing Complex Variables
- Inconvenient Collection Names
- 3. Creating, Updating, and Deleting Documents
- Inserting Documents
- insertMany
- Insert Validation
- insert
- Removing Documents
- drop
- Updating Documents
- Document Replacement
- Using Update Operators
- Getting started with the $set modifier
- Incrementing and decrementing
- Array operators
- Adding elements
- Using arrays as sets
- Removing elements
- Positional array modifications
- Updates using array filters
- Upserts
- The save shell helper
- Updating Multiple Documents
- Returning Updated Documents
- Inserting Documents
- 4. Querying
- Introduction to find
- Specifying Which Keys to Return
- Limitations
- Query Criteria
- Query Conditionals
- OR Queries
- $not
- Type-Specific Queries
- null
- Regular Expressions
- Querying Arrays
- $all
- $size
- $slice
- Returning a matching array element
- Array and range query interactions
- Querying on Embedded Documents
- $where Queries
- Cursors
- Limits, Skips, and Sorts
- Comparison order
- Avoiding Large Skips
- Paginating results without skip
- Finding a random document
- Immortal Cursors
- Limits, Skips, and Sorts
- Introduction to find
- II. Designing Your Application
- 5. Indexes
- Introduction to Indexes
- Creating an Index
- Introduction to Compound Indexes
- How MongoDB Selects an Index
- Using Compound Indexes
- Choosing key directions
- Using covered queries
- Implicit indexes
- How $ Operators Use Indexes
- Inefficient operators
- Ranges
- OR queries
- Indexing Objects and Arrays
- Indexing embedded docs
- Indexing arrays
- Multikey index implications
- Index Cardinality
- explain Output
- When Not to Index
- Types of Indexes
- Unique Indexes
- Compound unique indexes
- Dropping duplicates
- Partial Indexes
- Unique Indexes
- Index Administration
- Identifying Indexes
- Changing Indexes
- Introduction to Indexes
- 6. Special Index and Collection Types
- Geospatial Indexes
- Types of Geospatial Queries
- Using Geospatial Indexes
- 2D versus spherical geometry in queries
- Distortion
- Searching for restaurants
- Exploring the data
- Finding the current neighborhood
- Finding all restaurants in the neighborhood
- Finding restaurants within a distance
- Compound Geospatial Indexes
- 2d Indexes
- Indexes for Full Text Search
- Creating a Text Index
- Text Search
- Optimizing Full-Text Search
- Searching in Other Languages
- Capped Collections
- Creating Capped Collections
- Tailable Cursors
- Time-To-Live Indexes
- Storing Files with GridFS
- Getting Started with GridFS: mongofiles
- Working with GridFS from the MongoDB Drivers
- Under the Hood
- Geospatial Indexes
- 7. Introduction to the Aggregation Framework
- Pipelines, Stages, and Tunables
- Getting Started with Stages: Familiar Operations
- Expressions
- $project
- $unwind
- Array Expressions
- Accumulators
- Using Accumulators in Project Stages
- Introduction to Grouping
- The _id Field in Group Stages
- Group Versus Project
- Writing Aggregation Pipeline Results to a Collection
- 8. Transactions
- Introduction to Transactions
- A Definition of ACID
- How to Use Transactions
- Tuning Transaction Limits for Your Application
- Timing and Oplog Size Limits
- Introduction to Transactions
- 9. Application Design
- Schema Design Considerations
- Schema Design Patterns
- Normalization Versus Denormalization
- Examples of Data Representations
- Cardinality
- Friends, Followers, and Other Inconveniences
- Dealing with the Wil Wheaton effect
- Optimizations for Data Manipulation
- Removing Old Data
- Planning Out Databases and Collections
- Managing Consistency
- Migrating Schemas
- Managing Schemas
- When Not to Use MongoDB
- Schema Design Considerations
- III. Replication
- 10. Setting Up a Replica Set
- Introduction to Replication
- Setting Up a Replica Set, Part 1
- Networking Considerations
- Security Considerations
- Setting Up a Replica Set, Part 2
- Observing Replication
- Changing Your Replica Set Configuration
- How to Design a Set
- How Elections Work
- Member Configuration Options
- Priority
- Hidden Members
- Election Arbiters
- Use at most one arbiter
- The downside to using an arbiter
- Building Indexes
- 11. Components of a Replica Set
- Syncing
- Initial Sync
- Replication
- Handling Staleness
- Heartbeats
- Member States
- Elections
- Rollbacks
- When Rollbacks Fail
- Syncing
- 12. Connecting to a Replica Set from Your Application
- ClienttoReplica Set Connection Behavior
- Waiting for Replication on Writes
- Other Options for w
- Custom Replication Guarantees
- Guaranteeing One Server per Data Center
- Guaranteeing a Majority of Nonhidden Members
- Creating Other Guarantees
- Sending Reads to Secondaries
- Consistency Considerations
- Load Considerations
- Reasons to Read from Secondaries
- 13. Administration
- Starting Members in Standalone Mode
- Replica Set Configuration
- Creating a Replica Set
- Changing Set Members
- Creating Larger Sets
- Forcing Reconfiguration
- Manipulating Member State
- Turning Primaries into Secondaries
- Preventing Elections
- Monitoring Replication
- Getting the Status
- Visualizing the Replication Graph
- Replication Loops
- Disabling Chaining
- Calculating Lag
- Resizing the Oplog
- Building Indexes
- Replication on a Budget
- IV. Sharding
- 14. Introduction to Sharding
- What Is Sharding?
- Understanding the Components of a Cluster
- Sharding on a Single-Machine Cluster
- What Is Sharding?
- 15. Configuring Sharding
- When to Shard
- Starting the Servers
- Config Servers
- The mongos Processes
- Adding a Shard from a Replica Set
- Adding Capacity
- Sharding Data
- How MongoDB Tracks Cluster Data
- Chunk Ranges
- Splitting Chunks
- The Balancer
- Collations
- Change Streams
- 16. Choosing a Shard Key
- Taking Stock of Your Usage
- Picturing Distributions
- Ascending Shard Keys
- Randomly Distributed Shard Keys
- Location-Based Shard Keys
- Shard Key Strategies
- Hashed Shard Key
- Hashed Shard Keys for GridFS
- The Firehose Strategy
- Multi-Hotspot
- Shard Key Rules and Guidelines
- Shard Key Limitations
- Shard Key Cardinality
- Controlling Data Distribution
- Using a Cluster for Multiple Databases and Collections
- Manual Sharding
- 17. Sharding Administration
- Seeing the Current State
- Getting a Summary with sh.status()
- Seeing Configuration Information
- config.shards
- config.databases
- config.collections
- config.chunks
- config.changelog
- config.settings
- Tracking Network Connections
- Getting Connection Statistics
- Limiting the Number of Connections
- Server Administration
- Adding Servers
- Changing Servers in a Shard
- Changing a shard from a standalone server to a replica set
- Removing a Shard
- Balancing Data
- The Balancer
- Changing Chunk Size
- Moving Chunks
- Jumbo Chunks
- Distributing jumbo chunks
- Preventing jumbo chunks
- Refreshing Configurations
- Seeing the Current State
- V. Application Administration
- 18. Seeing What Your Application Is Doing
- Seeing the Current Operations
- Finding Problematic Operations
- Killing Operations
- False Positives
- Preventing Phantom Operations
- Using the System Profiler
- Calculating Sizes
- Documents
- Collections
- Databases
- Using mongotop and mongostat
- Seeing the Current Operations
- 19. An Introduction to MongoDB Security
- MongoDB Authentication and Authorization
- Authentication Mechanisms
- Authorization
- Using x.509 Certificates to Authenticate Both Members and Clients
- A Tutorial on MongoDB Authentication and Transport Layer Encryption
- Establish a CA
- Generate a root CA
- Create an intermediate CA for signing
- Generate and Sign Member Certificates
- Generate and Sign Client Certificates
- Bring Up the Replica Set Without Authentication and Authorization Enabled
- Create the Admin User
- Restart the Replica Set with Authentication and Authorization Enabled
- Establish a CA
- MongoDB Authentication and Authorization
- 20. Durability
- Durability at the Member Level Through Journaling
- Durability at the Cluster Level Using Write Concern
- The w and wtimeout Options for writeConcern
- The j (Journaling) Option for writeConcern
- Durability at a Cluster Level Using Read Concern
- Durability of Transactions Using a Write Concern
- What MongoDB Does Not Guarantee
- Checking for Corruption
- VI. Server Administration
- 21. Setting Up MongoDB in Production
- Starting from the Command Line
- File-Based Configuration
- Stopping MongoDB
- Security
- Data Encryption
- SSL Connections
- Logging
- Starting from the Command Line
- 22. Monitoring MongoDB
- Monitoring Memory Usage
- Introduction to Computer Memory
- Tracking Memory Usage
- Tracking Page Faults
- I/O Wait
- Calculating the Working Set
- Some Working Set Examples
- Tracking Performance
- Tracking Free Space
- Monitoring Replication
- Monitoring Memory Usage
- 23. Making Backups
- Backup Methods
- Backing Up a Server
- Filesystem Snapshot
- Snapshot backup and restore procedure
- Copying Data Files
- Using mongodump
- Moving collections and databases with mongodump and mongorestore
- Administrative complications with unique indexes
- Filesystem Snapshot
- Specific Considerations for Replica Sets
- Specific Considerations for Sharded Clusters
- Backing Up and Restoring an Entire Cluster
- Backing Up and Restoring a Single Shard
- 24. Deploying MongoDB
- Designing the System
- Choosing a Storage Medium
- Recommended RAID Configurations
- CPU
- Operating System
- Swap Space
- Filesystem
- Virtualization
- Memory Overcommitting
- Mystery Memory
- Handling Network Disk I/O Issues
- Using Non-Networked Disks
- Configuring System Settings
- Turning Off NUMA
- Setting Readahead
- Disabling Transparent Huge Pages (THP)
- Choosing a Disk Scheduling Algorithm
- Disabling Access Time Tracking
- Modifying Limits
- Configuring Your Network
- System Housekeeping
- Synchronizing Clocks
- The OOM Killer
- Turn Off Periodic Tasks
- Designing the System
- A. Installing MongoDB
- Choosing a Version
- Windows Install
- Installing as a Service
- POSIX (Linux and Mac OS X) Install
- Installing from a Package Manager
- B. MongoDB Internals
- BSON
- Wire Protocol
- Data Files
- Namespaces
- WiredTiger Storage Engine
- Index