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.
5. Document Model Benefits
• Agility and flexibility
– Data models can evolve easily
– Companies can adapt to changes quickly
• Intuitive, natural data representation
– Developers are more productive
– Many types of applications are a good fit
• Reduces the need for joins, disk seeks
– Programming is more simple
– Performance can be delivered at scale
6. Shell and Drivers
Drivers
Drivers for most popular
programming languages and
frameworks
Shell
Command-line shell for
interacting directly with
database
> db.collection.insert({company:“10gen”,
product:“MongoDB”})
>
> db.collection.findOne()
{
“_id” : ObjectId(“5106c1c2fc629bfe52792e86”),
“company” : “10gen”
“product” : “MongoDB”
}
Haskell
8. Automatic Sharding
• Increase or decrease capacity as you go
• Automatic balancing
• Three types of sharding:
hash-based
range-based
tag-aware
9. Query Routing
• Multiple query optimization models
• Many sharding options appropriate for different apps
11. Availability Considerations
• High Availability – Ensure application availability during
many types of failures
• Disaster Recovery – Address the RTO and RPO goals
for business continuity
• Maintenance – Perform upgrades and other
maintenance operations with no application downtime
12. Replica Sets
• Replica Set – two or more copies
• “Self-healing” shard
• Addresses many concerns:
- High Availability
- Disaster Recovery
- Maintenance
13. Replica Set Benefits
Business Needs Replica Set Benefits
High Availability Automated failover
Disaster Recovery Hot backups offsite
Maintenance Rolling upgrades
Low Latency Locate data near users
Workload Isolation Read from designated nodes
Data Consistency Tunable Consistency
21. Monitoring
• CLI and internal status commands
• mongostat; mongotop; db.serverStatus()
• Plug-ins for munin, Nagios, cacti, etc.
• Integration via SNMP to other tools
• MMS
23. MongoDB Management Service
Cloud-based suite of services for managing MongoDB deployments
• Charts, custom dashboards and automated alerting
• Tracks 100+ metrics – performance, resource utilization,
availability and response times
• 15,000+ users
24. MongoDB Management Service
Cloud-based suite of services for managing MongoDB deployments
• Backup and restore with
– point-in-time recovery,
– support for sharded clusters
• MMS On-Prem included with MongoDB Enterprise
(backup coming soon)
27. Monitoring Best Practices
• Monitor Logs
– Alert, escalate
– Correlate
• Disk
– Monitor
• Instrument/Monitor App (including logs!)
• Know your application and application (write) characteristics
Notes de l'éditeur
MongoDB is the leading open-source, document database.
Technical details of MongoDB
what makes it different from traditional relational database management systems.
data storage,
high availability and
scaling
deploying MongoDB in production.
operational challenges including
performance tuning,
capacity planning
deploy robust highly-available cluster topology
Dotted line is the natural boundary of what is possible today. Eg, ORCL lives far out on the right and does things nosql vendors will ever do. These things come at the expense of some degree of scale and performance.
NoSQL born out of wanting greater scalability and performance, but we think they overreacted by giving up some things. Eg, caching layers give up many things, key value stores are super fast, but give up rich data model and rich query model.
MongoDB tries to give up some features of a relational database (joins, complex transactions) to enable greater scalability and performance. You get most of the functionality – 80% - with much better scalability and performance.
Start with rdbms, ask what could we do to scale – take out complex transactions and joins. How? Change the data model. >> segue to data model section.
May need to revise the graphic – either remove the line or all points should be on the line.
To enable horizontal scalability, reduce coordination between nodes (joins and transactions). Traditionally in rdbms you would denormalize the data or tell the system more about how data relates to one another. Another way, a more intuitive way, is to use a document data model. More intuitive b/c closer to the way we develop applications today with object oriented languages, like java,.net, ruby, node.js, etc.
Document data model is good segue to next section >> Data Model
MongoDB provides agility, scalability, and performance without sacrificing the functionality of relational databases, like full index support and rich queriesIndexes: secondary, compound, text search (with MongoDB 2.4), geospatial, and more
Here we have greatly reduced the relational data model for this application to two tables. In reality no database has two tables. It is much more common to have hundreds or thousands of tables. And as a developer where do you begin when you have a complex data model?? If you’re building an app you’re really thinking about just a hand full of common things, like products, and these can be represented in a document much more easily that a complex relational model where the data is broken up in a way that doesn’t really reflect the way you think about the data or write an application.
Many factors affect performance
Make the right tradeoffs for your application
We can help you make the most of your MongoDB system
The following slides are examples of users and their systems.
servers – shards + HA requirements 4800/server; 10,000/server; 750/server
Many factors affect performance
Make the right tradeoffs for your application
We can help you make the most of your MongoDB system
The following slides are examples of users and their systems.