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
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 – Remove holding write lock on disk access for updates also – Stats available as part of db.serverStatus() • db.serverStatus().recordStats • db.serverStatus().extra_info
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
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
Use field in document to specify expiry. – db.log.events.ensureIndex({“expiryDate": 1}, {expireAfterSeconds: 3600}) • Separate mongod process 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
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
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
• 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
– 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