
Mastering MongoDB 3.x
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
More details
Other editions
Additional editions

Person
Alex Giamas is a freelance consultant and a hands-on Lead Technical and Data Architect. Over the past 15 years, he has expertise in designing and developing systems for the UK Government (HMRC, Cabinet Office, DIT) and private sector (Amazon ProServe, PwC, Fintech Fortune 500, Yahoo!, Verizon) clients. Alex is an alumnus of the MassChallenge London cohort as the co-founder and CTO of a digital health startup. Alex has authored Mastering MongoDB 3.x and 4.x, both by Packt Publishing. Alex has developed large-scale robust, distributed software systems in Python, JavaScript, Ruby, and Java. He is a MongoDB Certified Developer, a Cloudera Hadoop Certified Developer with Data Science Essentials, and a Carnegie Mellon and Stanford graduate.
Content
- Cover
- Copyright
- Credits
- About the Author
- About the Reviewers
- www.PacktPub.com
- Customer Feedback
- Table of Contents
- Preface
- Chapter 1: MongoDB - A Database for the Modern Web
- Web history
- Web 1.0
- Web 2.0
- Web 3.0
- SQL and NoSQL evolution
- MongoDB evolution
- Major feature set for versions 1.0 and 1.2
- Version 2
- Version 3
- Version 3+
- MongoDB for SQL developers
- MongoDB for NoSQL developers
- MongoDB key characteristics and use cases
- Key characteristics
- What is the use case for MongoDB?
- MongoDB criticism
- MongoDB configuration and best practices
- Operational best practices
- Schema design best practices
- Best practices for write durability
- Best practices for replication
- Best practices for sharding
- Best practices for security
- Best practices for AWS
- Reference documentation
- MongoDB documentation
- Packt references
- Further reading
- Summary
- Chapter 2: Schema Design and Data Modeling
- Relational schema design
- MongoDB schema design
- Read-write ratio
- Data modeling
- Data types
- Comparing different data types
- Date type
- ObjectId
- Modeling data for atomic operations
- Write isolation
- Read isolation and consistency
- Modeling relationships
- One-to-one
- One-to-many, many-to-many
- Modeling data for keyword searches
- Connecting to MongoDB
- Connecting using Ruby
- Mongoid ODM
- Inheritance with Mongoid models
- Connecting using Python
- PyMODM ODM
- Inheritance with PyMODM models
- Connecting using PHP
- Doctrine ODM
- Inheritance with Doctrine
- Summary
- Chapter 3: MongoDB CRUD Operations
- CRUD using the shell
- Scripting for the mongo shell
- Differences between scripting for the mongo shell and using it directly
- Batch inserts using the shell
- Batch operations using the mongo shell
- Administration
- fsync
- compact
- currentOp/killOp
- collMod
- touch
- MapReduce in the mongo shell
- MapReduce concurrency
- Incremental MapReduce
- Troubleshooting MapReduce
- Aggregation framework
- SQL to aggregation
- Aggregation versus MapReduce
- Securing the shell
- Authentication and authorization
- Authorization with MongoDB
- Security tips for MongoDB
- Encrypting communication using TLS/SSL
- Encrypting data
- Limiting network exposure
- Firewalls and VPNs
- Auditing
- Use secure configuration options
- Authentication with MongoDB
- Enterprise Edition
- Kerberos authentication
- LDAP authentication
- Summary
- Chapter 4: Advanced Querying
- MongoDB CRUD operations
- CRUD using the Ruby driver
- Creating documents
- Read
- Chaining operations in find()
- Nested operations
- Update
- Delete
- Batch operations
- CRUD in Mongoid
- Read
- Scoping queries
- Create, update, and delete
- CRUD using the Python driver
- Create and delete
- Finding documents
- Updating documents
- CRUD using PyMODM
- Creating documents
- Updating documents
- Deleting documents
- Querying documents
- CRUD using the PHP driver
- Create and delete
- Bulk write
- Read
- Update
- CRUD using Doctrine
- Create, update, and delete
- Read
- Best practices
- Comparison operators
- Update operators
- Smart querying
- Using regular expressions
- Query results and cursors
- Storage considerations on delete
- Summary
- Chapter 5: Aggregation
- Why aggregation?
- Aggregation operators
- Aggregation stage operators
- Expression operators
- Expression Boolean operators
- Expression comparison operators
- Set expression and array operators
- Expression date operators
- Expression string operators
- Expression arithmetic operators
- Aggregation accumulators
- Conditional expressions
- Other operators
- Text search
- Variable
- Literal
- Parsing data type
- Limitations
- Aggregation use case
- Summary
- Chapter 6: Indexing
- Index internals
- Index types
- Single field indexes
- Indexing embedded fields
- Indexing embedded documents
- Background indexes
- Compound indexes
- Sorting using compound indexes
- Reusing compound indexes
- Multikey indexes
- Special types of index
- Text
- Hashed
- TTL
- Partial
- Sparse
- Unique
- Case-insensitive
- Geospatial
- Building and managing indexes
- Forcing index usage
- Hint and sparse indexes
- Building indexes on replica sets
- Managing indexes
- Naming indexes
- Special considerations
- Using indexes efficiently
- Measuring performance
- Improving performance
- Index intersection
- References
- Summary
- Chapter 7: Monitoring, Backup, and Security
- Monitoring
- What should we monitor?
- Page faults
- Resident memory
- Virtual and mapped memory
- Working set
- Monitoring memory usage in WiredTiger
- Tracking page faults
- Tracking B-tree misses
- I/O wait
- Read and write queues
- Lock percentage
- Background flushes
- Tracking free space
- Monitoring replication
- Oplog size
- Working set calculations
- Monitoring tools
- Hosted tools
- Open source tools
- Backups
- Backup options
- Cloud-based solutions
- Backups with file system snapshots
- Taking a backup of a sharded cluster
- Backups using mongodump
- Backups by copying raw files
- Backups using queueing
- EC2 backup and restore
- Incremental backups
- Security
- Authentication
- Authorization
- User roles
- Database administration roles
- Cluster administration roles
- Backup restore roles
- Roles across all databases
- Superuser
- Network level security
- Auditing security
- Special cases
- Overview
- Summary
- Chapter 8: Storage Engines
- Pluggable storage engines
- WiredTiger
- Document-level locking
- Snapshots and checkpoints
- Journaling
- Data compression
- Memory usage
- readConcern
- WiredTiger collection-level options
- WiredTiger performance strategies
- WiredTiger B-tree versus LSM indexes
- Encrypted
- In-memory
- MMAPv1
- MMAPv1 storage optimization
- Mixed usage
- Other storage engines
- RocksDB
- TokuMX
- Locking in MongoDB
- Lock reporting
- Lock yield
- Commonly used commands and locks
- Commands requiring a database lock
- References
- Summary
- Chapter 9: Harnessing Big Data with MongoDB
- What is big data?
- Big data landscape
- Message queuing systems
- Apache ActiveMQ
- RabbitMQ
- Apache Kafka
- Data warehousing
- Apache Hadoop
- Apache Spark
- Spark comparison with Hadoop MapReduce
- MongoDB as a data warehouse
- Big data use case
- Kafka setup
- Hadoop setup
- Steps
- Hadoop to MongoDB pipeline
- Spark to MongoDB
- References
- Summary
- Chapter 10: Replication
- Replication
- Logical or physical replication
- Different high availability types
- Architectural overview
- How do elections work?
- What is the use case for a replica set?
- Setting up a replica set
- Converting a standalone server to a replica set
- Creating a replica set
- Read preference
- Write concern
- Custom write concern
- Priority settings for replica set members
- Priority zero replica set members
- Hidden replica set members
- Delayed replica set members
- Production considerations
- Connecting to a replica set
- Replica set administration
- How to perform maintenance on replica sets
- Resyncing a member of a replica set
- Changing the oplog size
- Reconfiguring a replica set when we have lost the majority of our servers
- Chained replication
- Cloud options for a replica set
- mLab
- MongoDB Atlas
- Replica set limitations
- Summary
- Chapter 11: Sharding
- Advantages of sharding
- Architectural overview
- Development, continuous deployment, and staging environments
- Planning ahead on sharding
- Sharding setup
- Choosing the shard key
- Changing the shard key
- Choosing the correct shard key
- Range-based sharding
- Hash-based sharding
- Coming up with our own key
- Location-based data
- Sharding administration and monitoring
- Balancing data - how to track and keep our data balanced
- Chunk administration
- Moving chunks
- Changing the default chunk size
- Jumbo chunks
- Merging chunks
- Adding and removing shards
- Sharding limitations
- Querying sharded data
- The query router
- Find
- Sort/limit/skip
- Update/remove
- Querying using Ruby
- Performance comparison with replica sets
- Sharding recovery
- Mongos
- Mongod process
- Config server
- A shard goes down
- The entire cluster goes down
- References
- Summary
- Chapter 12: Fault Tolerance and High Availability
- Application design
- Schema-less doesn't mean schema design-less
- Read performance optimization
- Consolidating read querying
- Defensive coding
- Monitoring integrations
- Operations
- Security
- Enabling security by default
- Isolating our servers
- Checklists
- References
- Summary
- Index
System requirements
File format: ePUB
Copy protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (not Kindle).
The file format ePub works well for novels and non-fiction books – i.e., „flowing” text without complex layout. On an e-reader or smartphone, line and page breaks automatically adjust to fit the small displays.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our ebook Help page.