mongodb2.2更新内容

来源:互联网 发布:网络销售公司介绍 编辑:程序博客网 时间:2024/09/21 08:54

主要的更新如下:

1.新增了聚合框架

  聚合框架,使得它可以做聚合操作,而无需使用map-reduce。
  比如 数据结构如下:{"_id":"10280","city":"NEW YORK","state":"NY","pop":5574,"loc":[-74.016323,40.710537]}
  要返回所有国家,人口超过1000万,使用下面的聚合操作:db.zipcodes.aggregate( { $group :
                         { _id : "$state",
                           totalPop : { $sum : "$pop" } } },
                       { $match : {totalPop : { $gte : 10*1000*1000 } } } )

2.Improved Data Center Awareness with Tag Aware Sharding
MongoDB 2.2 adds additional support for geographic distribution or other custom partitioning for sharded collections in clusters. 
By using this “tag aware” sharding, you can automatically ensure that data in a sharded database system is always on specific shards. 
For example, with tag aware sharding, you can ensure that data is closest to the application servers that use that data most frequently.

Shard tagging controls data location, and is complementary but separate from replica set tagging, which controls read preference and write concern. 
For example, shard tagging can pin all “USA” data to one or more logical shards, 
while replica set tagging can control which mongod instances (e.g. “production” or “reporting”) the application uses to service requests.


See the documentation for the following helpers in the mongo shell that support tagged sharding configuration:


sh.addShardTag()
sh.addTagRange()
sh.removeShardTag()
Also, see the wiki page for tag aware sharding.

3.并发改进

  MongoDB的2.2增加了服务器的并发操作能力,现在支持数据库级锁定。


详情见,官方地址:http://docs.mongodb.org/manual/release-notes/2.2/#changes

原创粉丝点击