mongodb 101 & beyond: get started in mongodb 3.0, preview 3.2 & demo of ops manager, muthu...

35
MongoDB 3.x & Ops Manager Muthu Chinnasamy Senior Solutions Architect [email protected]

Upload: mongodb

Post on 26-Jan-2017

1.616 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB

MongoDB 3.x & Ops Manager

Muthu ChinnasamySenior Solutions [email protected]

Page 2: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB

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

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

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

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

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
Page 8: MongoDB 101 & Beyond: Get Started in MongoDB 3.0, Preview 3.2 & Demo of Ops Manager, Muthu Chinnasamy, Sr. Solutions Architect, MongoDB

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

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

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

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

• 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

• 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

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

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

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

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

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

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

• 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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Thank You!

Questions?