Slide 1

Slide 1 text

1 Ben Becker, Software Engineer, 10gen [email protected]

Slide 2

Slide 2 text

2 2.2 Aug ‘12 2.0 Sept ‘11 1.8 March ‘11 Journaling Sharding and Replica set enhancements Spherical geo search Index enhancements to improve size and performance Authentication with sharded clusters Replica Set Enhancements Concurrency improvements Aggregation Framework Multi-Data Center Deployments Improved Performance and Concurrency

Slide 3

Slide 3 text

3 2.2 - rc0 released on 7/19 2.2 - rc1 released today! 2.2 - out soon!

Slide 4

Slide 4 text

4 • Concurrency improvements – DB Level Locking – More yielding • Aggregation Framework • Tag aware sharding or geo-sharding • Read Preferences • TTL Collections • Shell enhancements • More…

Slide 5

Slide 5 text

5 • DB Level Locking – Write operations lock at db level, not globally • Replication can happen in parallel to write (client db vs. local) – Global lock for journaling, fsync etc. only – db.serverStatus() enhanced to show lock stats per db • Yielding on page fault – Started with 2.0 – Avoid holding write lock on disk access for updates also – Stats available as part of db.serverStatus() • db.serverStatus().recordStats • db.serverStatus().extra_info

Slide 6

Slide 6 text

6 • Replaces most common uses of map/reduce • Implemented in C++. Hence better performance than interpreted JavaScript • Operators can be chained similar to Unix pipes • Framework allows easy implementation of new operators • Pipeline and compute operators : $project, $unwind $group, $sort, $skip, $add, string functions • Use $match and $sort early in the pipeline. Query optimizer can use indexes

Slide 7

Slide 7 text

7 • Operators – $project – specified fields, compute values etc. – $unwind – stream arrays – $group – aggregate on key • Document with tags (array of strings). E.g. db.posts.aggregate( {$unwind : "$tags"} , {$group : {_id : "$tags", total :{$sum : 1}}}) • Doc - http://docs.mongodb.org/manual/applications/aggr egation/

Slide 8

Slide 8 text

8 • Most common use - • Implemented as generic tags on shard members – geographically locate data – distribute based on usage • Add tags to shards – sh.addShardTag( "shard0000" , "a" ) • Specify range by tag – sh.addTagRange( "test.foo" , { _id : -1 } , { _id : 1000 } , "a" ) • More info – https://github.com/mongodb/mongo/blob/master/jstests/ slowNightly/balance_tags1.js

Slide 9

Slide 9 text

9

Slide 10

Slide 10 text

10 • Consistent nomenclature across drivers and mongos • Modes – Primary (default), Primary_Preferred, Secondary, Secondary_Preferred, Nearest • Replica set tags – Read support for replica set tags

Slide 11

Slide 11 text

11 • Auto expire data by setting a TTL • Use field in document to specify expiry. – db.log.events.ensureIndex({“expiryDate": 1}, {expireAfterSeconds: 3600}) • Dedicated mongod thread regularly removes • Can be used with replication and sharding • Constraints – Should have a date type value – Cannot be compound – Cannot be used on capped collection

Slide 12

Slide 12 text

12 • Verbose mode – Shows number of documents affected, time taken > db.foo.update({},{$set:{newfield:10}},false,true) > set verbose true set verbose to true > db.foo.update({},{$set:{newfield:10}},false,true) Updated 2 existing record(s) in 2ms • slaveOk – Settings similar to drivers – Greater control from shell or scripts – > db.getMongo().setSlaveOk() – > db.setSlaveOk() – > db.foo.setSlaveOk() • Enhanced editing features

Slide 13

Slide 13 text

13 • Replication – replsetSyncFrom – specify who to sync from • Tools – mongooplog – tool for replaying oplog – Authentication support and concurrency statistics in mongotop and mongostat • 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

14

Slide 15

Slide 15 text

15 • Download – http://www.mongodb.org/downloads • Release notes – http://docs.mongodb.org/manual/release-notes/2.2 • Resolved issues – https://jira.mongodb.org/secure/IssueNavigator.jspa?mod e=hide&requestId=10907 • Backward breaking changes – https://jira.mongodb.org/secure/IssueNavigator.jspa?requ estId=11225

Slide 16

Slide 16 text

16 • Standard incremental update. Hence a drop in replacement • Standalone – Shutdown and replace • Replica Set – Rolling upgrade starting with secondaries • Sharded Cluster – Mongos, Config servers and then rolling upgrade of shards • More details at http://docs.mongodb.org/manual/release- notes/2.2/#upgrading

Slide 17

Slide 17 text

17

Slide 18

Slide 18 text

18 • Operational enhancements – Integration with external authentication systems – Simplified sharding setup – Further reductions in fragmentation • New features – Built in full-text search • Performance improvements – Further concurrency improvements – Improved aggregation framework performance – More efficient usage of indexes, including multiple indexes on a single query

Slide 19

Slide 19 text

19 @mongodb conferences, appearances, and meetups http://www.10gen.com/events http://bit.ly/mongofb Facebook | Twitter | LinkedIn http://linkd.in/joinmongo download at mongodb.org We’re Hiring ! [email protected]