MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu...
-
Upload
mongodb -
Category
Technology
-
view
1.623 -
download
2
Transcript of MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu...
![Page 2: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB](https://reader035.fdocuments.net/reader035/viewer/2022081505/5889d3d91a28ab83478b4f51/html5/thumbnails/2.jpg)
MongoDB is for…
![Page 3: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB](https://reader035.fdocuments.net/reader035/viewer/2022081505/5889d3d91a28ab83478b4f51/html5/thumbnails/3.jpg)
Some of the Giant Ideas Using MongoDB
![Page 4: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB](https://reader035.fdocuments.net/reader035/viewer/2022081505/5889d3d91a28ab83478b4f51/html5/thumbnails/4.jpg)
MongoDB Adds Business Value
Competitive Advantage Mitigating Risk
Lower TCOFaster Time to Value
![Page 5: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB](https://reader035.fdocuments.net/reader035/viewer/2022081505/5889d3d91a28ab83478b4f51/html5/thumbnails/5.jpg)
Agenda
• What's new in MongoDB 3.0?• Ops manager - Automation, backup,
monitoring• What's new in version 3.2?• Q&A
![Page 6: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB](https://reader035.fdocuments.net/reader035/viewer/2022081505/5889d3d91a28ab83478b4f51/html5/thumbnails/6.jpg)
What's new in MongoDB 3.0?
![Page 7: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB](https://reader035.fdocuments.net/reader035/viewer/2022081505/5889d3d91a28ab83478b4f51/html5/thumbnails/7.jpg)
![Page 8: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB](https://reader035.fdocuments.net/reader035/viewer/2022081505/5889d3d91a28ab83478b4f51/html5/thumbnails/8.jpg)
Pluggable Storage Engines
![Page 9: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB](https://reader035.fdocuments.net/reader035/viewer/2022081505/5889d3d91a28ab83478b4f51/html5/thumbnails/9.jpg)
Pluggable Storage Engines
Content Repo
IoT Sensor Backend Ad Service Customer
Analytics Archive
MongoDB Query Language (MQL) + Native Drivers
MongoDB Document Data Model
MMAP V1 WT In-Memory ? ?
Supported in MongoDB 3.0 Future Possible Storage Engines
Man
agem
ent
Sec
urity
Example Future State
Experimental
![Page 10: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB](https://reader035.fdocuments.net/reader035/viewer/2022081505/5889d3d91a28ab83478b4f51/html5/thumbnails/10.jpg)
Introducing WiredTiger
• Pluggable storage engines!• MMAPv1 (Default)• wiredTiger
![Page 11: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB](https://reader035.fdocuments.net/reader035/viewer/2022081505/5889d3d91a28ab83478b4f51/html5/thumbnails/11.jpg)
Additional flag when launching 3.0.x mongod:
--storageEngine=wiredTiger
How Do I run WiredTiger?
![Page 12: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB](https://reader035.fdocuments.net/reader035/viewer/2022081505/5889d3d91a28ab83478b4f51/html5/thumbnails/12.jpg)
• Cannot copy raw data files. WT will fail to start if it finds wrong data format
• Two ways to perform an engine upgrade:• Mongodump/Mongorestore• Add new replica member with WT
• You can run replicas with mixed storage engines
How Do I Upgrade to it?
![Page 13: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB](https://reader035.fdocuments.net/reader035/viewer/2022081505/5889d3d91a28ab83478b4f51/html5/thumbnails/13.jpg)
• Document-level concurrency• Compression• Consistency without journaling• Better performance for write heavy
workloads• Vertically scalable as it allows full hardware
utilization• Index placement on faster storage devices
Why is WiredTiger Awesome?
![Page 14: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB](https://reader035.fdocuments.net/reader035/viewer/2022081505/5889d3d91a28ab83478b4f51/html5/thumbnails/14.jpg)
mmapv1 2.6 concurrency model
Lock manager has a toll booth for each database
Reads and writes must acquire database level lock
![Page 15: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB](https://reader035.fdocuments.net/reader035/viewer/2022081505/5889d3d91a28ab83478b4f51/html5/thumbnails/15.jpg)
mmapv1 3.0 concurrency model
Lock manager has a toll booth for each collection
Reads and writes must acquire collection level lock
![Page 16: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB](https://reader035.fdocuments.net/reader035/viewer/2022081505/5889d3d91a28ab83478b4f51/html5/thumbnails/16.jpg)
7-10x Better Write Performance
No toll booths!Atomic update replaces latching/lockingYields on write contention to same document
![Page 17: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB](https://reader035.fdocuments.net/reader035/viewer/2022081505/5889d3d91a28ab83478b4f51/html5/thumbnails/17.jpg)
Up to 80% Compression
• WiredTiger uses snappy compression by default in MongoDB
• Supported compression algorithms – snappy [default]: good compression, low overhead– zlib: better compression, more CPU– none
• Indexes are compressed using prefix compression– allows compression in RAM
500GB 100GB
![Page 18: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB](https://reader035.fdocuments.net/reader035/viewer/2022081505/5889d3d91a28ab83478b4f51/html5/thumbnails/18.jpg)
Compression – mongod options
--wiredTigerCollectionBlockCompressor (=snappy)
[snappy|zlib|none]
--wiredTigerJournalCompressor (=snappy)
--wiredTigerIndexPrefixCompression (=1)
![Page 19: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB](https://reader035.fdocuments.net/reader035/viewer/2022081505/5889d3d91a28ab83478b4f51/html5/thumbnails/19.jpg)
Compression – Object options
db.createCollection( "coll", {storageEngine: {wiredTiger: { configString: "block_compressor=snappy" }}})
db.coll.createIndex({a:1},{storageEngine: {wiredTiger: { configString: "block_compressor=zlib"}}})
![Page 20: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB](https://reader035.fdocuments.net/reader035/viewer/2022081505/5889d3d91a28ab83478b4f51/html5/thumbnails/20.jpg)
• WiredTiger cache stores uncompressed data• Ideally, working set fits in WT cache
1. File system cache stores compressed data2. Uses higher value of 50% of RAM or 1GB
WiredTiger Cache
--wiredTigerCacheSizeGB {arg}
![Page 21: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB](https://reader035.fdocuments.net/reader035/viewer/2022081505/5889d3d91a28ab83478b4f51/html5/thumbnails/21.jpg)
Ensure indexes fit in RAM
![Page 22: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB](https://reader035.fdocuments.net/reader035/viewer/2022081505/5889d3d91a28ab83478b4f51/html5/thumbnails/22.jpg)
Ops Manager
![Page 23: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB](https://reader035.fdocuments.net/reader035/viewer/2022081505/5889d3d91a28ab83478b4f51/html5/thumbnails/23.jpg)
How Ops Manager Helps You
Scale EasilyMeet SLAs
Best Practices, Automated
Cut Management Overhead
23
![Page 24: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB](https://reader035.fdocuments.net/reader035/viewer/2022081505/5889d3d91a28ab83478b4f51/html5/thumbnails/24.jpg)
Zero Downtime Cluster UpgradesManual Steps
• Manual steps upgrading a 2.6.11 sharded cluster to 3.0.6 version, on enterprise edition, and convert the storage engine to wiredTiger
24
Upgrades, downgrades150+ steps
Example Deployment – 6 Servers
![Page 25: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB](https://reader035.fdocuments.net/reader035/viewer/2022081505/5889d3d91a28ab83478b4f51/html5/thumbnails/25.jpg)
Zero Downtime Cluster UpgradesOps Manager Automation
• Using Ops Manager automation• Start with a 2.6.11 Community cluster• Upgrade to 3.0.6 Enterprise cluster• Convert storage Engine to wiredTiger
Turn long and complicated manual processes into single click operations with Ops Manager automation
Ensure availability during system upgrades
25
![Page 26: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB](https://reader035.fdocuments.net/reader035/viewer/2022081505/5889d3d91a28ab83478b4f51/html5/thumbnails/26.jpg)
Summary: Benefits of MongoDB 3.0
![Page 27: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB](https://reader035.fdocuments.net/reader035/viewer/2022081505/5889d3d91a28ab83478b4f51/html5/thumbnails/27.jpg)
What's new in version 3.2
![Page 28: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB](https://reader035.fdocuments.net/reader035/viewer/2022081505/5889d3d91a28ab83478b4f51/html5/thumbnails/28.jpg)
New in MongoDB 3.2
![Page 29: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB](https://reader035.fdocuments.net/reader035/viewer/2022081505/5889d3d91a28ab83478b4f51/html5/thumbnails/29.jpg)
MongoDB 3.2 New Features
• Fast failovers– 2-seconds election times
• Support for more than 3 data centers– Config servers as replica sets
• Cluster read-committed– readConcern: { level: <majority|local>
• WiredTiger default storage engine• Aggregation framework enhancements
– New stages $sample– New arithmetic operators & accumulators
• Mongo shell enhancements
![Page 30: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB](https://reader035.fdocuments.net/reader035/viewer/2022081505/5889d3d91a28ab83478b4f51/html5/thumbnails/30.jpg)
MongoDB 3.2 – Compass
![Page 31: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB](https://reader035.fdocuments.net/reader035/viewer/2022081505/5889d3d91a28ab83478b4f51/html5/thumbnails/31.jpg)
MongoDB 3.2 – Left Outer Joins• Create a new field in aggregated documents "cust_orders"
containing array of documents from "orders" collection • Similar to where "customers"."_id"="orders"."cust_id"
Db.customers.aggregate([ {
$lookUp: { from: "orders", localField: "_id", foreignField: "cust_id", as: "cust_orders" }
}])
![Page 32: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB](https://reader035.fdocuments.net/reader035/viewer/2022081505/5889d3d91a28ab83478b4f51/html5/thumbnails/32.jpg)
MongoDB 3.2 – Encryption at rest
• Encryption is a database-level option– Master key & local keys allow for easier key
management and key rotation for compliance• Supports standard 3rd party key management
appliances (KMIP)• Default encryption schema is AES256-CBC
– Also have GCM• FIPS 140-2 compliant option
![Page 33: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB](https://reader035.fdocuments.net/reader035/viewer/2022081505/5889d3d91a28ab83478b4f51/html5/thumbnails/33.jpg)
MongoDB 3.2 – Partial Indexes
> db.customers.createIndex({ state:1}, { partialFilterExpression: { active: {$eq : 'Y'}}}){
"createdCollectionAutomatically" : false,"numIndexesBefore" : 1,"numIndexesAfter" : 2,"ok" : 1
}Index only for docs matching the filter
expression
![Page 34: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB](https://reader035.fdocuments.net/reader035/viewer/2022081505/5889d3d91a28ab83478b4f51/html5/thumbnails/34.jpg)
MongoDB 3.2 – Document Validation> db.runCommand({"collMod": 'customers', "validator" : {email: {$exists: true}}}){ "ok" : 1 }
> db.customers.insert({name:'Rose McClendon', age:27, state:'CA', city:'San Francisco', zip:94301})
WriteResult({"nInserted" : 0,"writeError" : {
"code" : 121,"errmsg" : "Document failed validation"
}})
> db.customers.insert({name:'Rose McClendon', age:27, email:'[email protected]', state:'CA', city:'San Francisco', zip:94301})WriteResult({ "nInserted" : 1 })
Enforces email field
![Page 35: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB](https://reader035.fdocuments.net/reader035/viewer/2022081505/5889d3d91a28ab83478b4f51/html5/thumbnails/35.jpg)
Thank You!
Questions?