Slide 1

Slide 1 text

An evening in Toronto with MongoDB 2.2 Jenna deBoisblanc Support Engineer, 10gen [email protected] @jdeboisblanc

Slide 2

Slide 2 text

MongoDB Releases 2.2 Aug ‘12 2.0 Sept ‘11 1.8 March ‘11 2.2-rc0: July 19th 2.2-rc1: targeted July 31st 2.2 – out shortly after

Slide 3

Slide 3 text

Concurrency)improvements Aggregation)framework Tag)aware)sharding Read)Preferences TTL)Collections Shell)enhancements More… • • • • • • • New features in 2.2

Slide 4

Slide 4 text

DB#Level#Locking Global#lock#for#journaling,#fsync#etc.#only Easy#transition#to#collection;level#locks Replication#can#happen#in#parallel#to#write#(client#db#vs. local) Yielding#on#page#faults Started#with#2.0 Yielding#for#updates • – – – • – – Concurrency Improvements

Slide 5

Slide 5 text

Concurrency Stats db.serverStatus(-)- shows-db-level-locks page-fault-details • – – > db.serverStatus().recordStats { "accessesNotInMemory" : 1, "pageFaultExceptionsThrown" : 1, "local" : { "accessesNotInMemory" : 0, "pageFaultExceptionsThrown" : 0 }, "test" : { .... } “foo” : { ... } }

Slide 6

Slide 6 text

Replaces(common(uses(of(map/reduce Implemented(in(C++ Query(optimizer(can(use(indexes Chained(operators $project(–(specified(fields,(compute(values(etc. $unwind(–(stream(arrays $group(–(aggregate(on(key $match $sort • • • • – – – – – Aggregation framework

Slide 7

Slide 7 text

{"_id:"1,"tags:"[“Jenna”,"“pizza”]"} {"_id:"2,"tags:"[“Jenna”,"“sushi”,"“pizza”]"} >db.collection.aggregate( """""{$unwind:"“$tags”}, """""{$group:"{_id:"“$tags”,"total:"{$sum:1}"}"}") "result"":"[ """"""""""""""""{"_id"":""sushi",""total"":"1}, """"""""""""""""{"_id"":""pizza",""total"":"2}, """"""""""""""""{"_id"":""Jenna",""total"":"2} """"""""] Aggregation Framework – example

Slide 8

Slide 8 text

Use$cases force$writes$to$local$data$center distribute$data$based$on$usage • – – Tag aware sharding

Slide 9

Slide 9 text

Modes Drivers*set*on*a*per/connection,*per/collection,*or per/operation*basis Primary*(default)* Primary_Preferred Secondary Secondary_Preferred Nearest Replica*set*tags Read*support*for*replica*set*tags • – • • • • • • – Read Preferences

Slide 10

Slide 10 text

“Time%To%Live” Use%field%in%document%to%specify%expiry Constraints Indexed%field%must%be%a%BSON%date%type Cannot%be%used%on%capped%collection • • • – – TTL Collections {_id:%1,%name:%“Jenna”,%status:%BSONDate} >%db.log.ensureIndex({“status”:%1},%{expireAfterSeconds:%3600})

Slide 11

Slide 11 text

Verbose'mode >'set$verbose$true >'db.foo.update('{'},'{$set:'{field:'10}'}') Updated'2'existing'record(s)'in'2ms Enhanced'editing'features multiDline'support • • – Shell enhancements

Slide 12

Slide 12 text

Replication rs.syncFrom(2“[hostname]2:2[port]”2)2 specify2who2to2sync2from Tools mongooplog2–2tool2for2replaying2oplog Authentication2support2and2concurrency2statistics2in mongotop2and2mongostat • – • – – More…

Slide 13

Slide 13 text

Even More! Query&optimizer Many&improvements&not&directly&visible&to&user Better&support&for&$in&+&sort&+&limit Map/reduce Choose&initial&split&points&for&sharded&output • – – • –

Slide 14

Slide 14 text

What’s next?

Slide 15

Slide 15 text

Operational+enhancements External+authentication+integration Fragmentation+reduction New+features Full9text+search Performance+improvements More+granular+locks Improved+aggregation+framework Index+improvements • – – • – • – – – Post 2.2

Slide 16

Slide 16 text

We’re Hiring ! [email protected] mongoDB.org