New to MongoDB? We'll provide an overview of installation, high availability through replication, scale out through sharding, and options for monitoring and backup. No prior knowledge of MongoDB is assumed. This session will jumpstart your knowledge of MongoDB operations, providing you with context for the rest of the day's content.
6. Just a Database
Native High Availability
Automated replication and failover
Multi-data center support
Improved operational simplicity
(e.g., HW swaps)
Data durability and consistency
8. 8
Single Data Center
• Automated failover
• Tolerates server failures
• Tolerates rack failures
• Number of replicas
defines failure tolerance
Primary – A
Secondary – A Secondary – A
9. 9
Active/Standby Data Center
Primary – A
Secondary – A
Data Center - West
Secondary – A
• Tolerates server and rack failure
• Standby data center
Data Center - East
10. 10
Active/Active Data Center
Primary – A
Secondary – A
Data Center - West
Secondary – A
Data Center - East
Arbiter – A
• Tolerates server, rack, data center failures, network
partitions
Secondary – A
Data Center - Central
11. 11
Enterprise Security
Business Needs Security Features
Authentication
LDAP*
Kerberos*
x.509 Certificates*
Authorization
User-Defined Roles
Field-Level Redaction
Auditing
Admin Operations*
CRUD
Encryption
Network: SSL
At Rest: Certified Partner Solutions
*Included with MongoDB Enterprise
13. 13
Typical Small Deployment
Highly Available
but not Scalable
Replica Set
Writes Reads
Limited by capacity
of the Primary’s
host
When Immediate
Consistency
Matters: Limited by
capacity of the
Primary’s host
When Eventual
Consistency is
Acceptable: Limited
by capacity of
available replicaSet
members
14. 14
Sharded Architecture
Auto-balancing:
data is partitioned
based on a shard
key, and
automatically
balanced across
shards by MongoDB
Query Routing: database
operations are
transparently routed
across the cluster
through a routing proxy
process (software).
Horizontal Scalability:
load is distributed and
resources are pooled
across commodity
servers.
Increasing read/write capacity
Decoupling for
Development and
Operational Simplicity:
Ops can add capacity
without app dependencies
and Dev involvement.
15. 15
NoSQL
Wikipedia: A NoSQL (often interpreted as Not Only SQL) database provides a
mechanism for storage and retrieval of data that is modeled in means other
than the tabular relations used in relational databases.
Acceleration: -9.8 m/s2
Velocity: 90 m/s
Heart Rate: 150 bpm
17. Why Document Model?
Drivers Features Use Cases
Simplicity: Data fits
Semi-structure (JSON)
documents better than
tabular relations enabling
Low Object Impedance (no
greater developer
ORM needed)
productivity
CMS: eg) news articles
EHR: eg) patient records
Web/Mobile Apps: End-to-
end JSON
Dynamic Schema:
schema too volatile and
variable to practically
maintain in a relational
model.
Support for multiple
schemas
Easy manipulation of
attributes
SaaS: no downtime (lazy)
schema migrations
Data Hub: easy integration
and MDM (eg. Customer)
across a large number of
external systems.
Product Catalog: volatile
schema and many
unknown attributes.
21. Powerful Query Language
Key-Value SQL
GET Value by Key
PUT Value by Key
Primary Indexing
Secondary Indexing
with Limitations
SCAN
MongoDB
Full Secondary
Indexing
Range Queries and
Advance Operators
Geo Spatial
Full Text Search
Aggregation
Map Reduce
Multi-op
transactions
Joins
- Scale
- Dynamic Data
Model
22. 23
Drivers
Drivers: Drivers for most popular programming languages and frameworks
Java
Python
Perl
Ruby
Haskell
JavaScript
23. 24
Management
Tools and Resources
Acceleration: -9.8 m/s2
Velocity: 7 m/s
Heart Rate: 80 bpm
24. 25
Resources
Resource
Community mongodb.org
Production Notes:
docs.mongodb.org/manual/administration/production-notes/
DB Commands:
docs.mongodb.org/manual/reference/command/
Training university.mongodb.com
Online Training: university.mongodb.com/courses/schedule
Certification: university.mongodb.com/exams
Server
Distributions
Enterprise: mongodb.com/download
Community: mongodb.org/downloads
Database Tool mms.mongodb.com
Case Studies mongodb.com/customers
White Papers mongodb.com/white-papers
25. 26
Diagnostics
Do you know what the problem queries are?
YES NO
Use Explain() to evaluate
query plans
Analyze using
Profiler and/or MMS
Review current index
strategy and create new
indexes as necessary
NEW INDEX
CREATED
Document moves
occurring?
Nmoved=1
INDEX
EXISTS
Are there still
Performance Issues?
Consider schema re-factoring
(pre-allocate space), or set larger
padding (eg. powersOf2Sizes)
Identify and fix bottlenecks in
MMS
Query Plan:
http://docs.mongod
b.org/manual/core/
query-plans/
Profiler:
http://docs.mongod
b.org/manual/tutori
al/manage-the-database-
profiler/
MMS:
https://mms.mongo
db.com
…
NO YES
Problem Solved!
26. 27
Operational Scale
How do I manage 100s to 1000s of nodes?
MongoDB Management Services (MMS): https://mms.mongodb.com
• Real-time monitoring
and visualization of
cluster health
• Alerting
• Automated cluster
provisioning
• Automation of daily
operational tasks like no-downtime
upgrades
• Centralized configuration
management
• Automated PIT
snapshotting of
clusters
• PITR support for
sharded clusters