码迷,mamicode.com
首页 > 数据库 > 详细

mongodb

时间:2014-12-20 20:52:59      阅读:268      评论:0      收藏:0      [点我收藏+]

标签:

数据库 系统性能、负载和容量

Cursor Isolation

Because the cursor is not isolated during its lifetime, intervening write operations on a document may result in a cursor that returns a document more than once if that document has changed. To handle this situation, see the information on snapshot mode

 

为了实现低延迟的数据库操作MongoDB中广泛使用了RAM。在MongoDB中,所有的数据都是通过内存映射文件读取和操作的。从内存中读取数据是使用纳秒来度量的,而从磁盘中读取数据则是使用毫秒度量的,所以从内存中读取数据几乎比从磁盘中读取要快了十万倍。

 

MongoDB能够使用本地附加的存储和固态硬盘(SSD)

Sharding可以让MongoDB的部署解决单个服务器的硬件限制而不需要增加应用程序的复杂性,解决的硬件限制包括RAM和磁盘I/O的瓶颈。

 

The maximum BSON document size is 16 megabytes.

索引优化查询

All indexes in MongoDB are B-tree indexes

A single collection can have no more than 64 indexes;There can be no more than 31 fields in a compound index;

The total size of an index entry, which can include structural overhead depending on the BSON type, must be less than 1024 bytes.

By default, all collections have an index on the _id field

By default, creating an index blocks all other operations on a database. When building an index on a collection, the database that holds the collection is unavailable for read or write operations until the index build completes. Any operation that requires a read or write lock on all databases (e.g. listDatabases) will wait for the foreground index build to complete.

可以考虑background模式执行建立索引

MongoDB allows you to specify a unique constraint on an index. These constraints prevent applications from inserting documents that have duplicate values for the inserted fields. Additionally, if you want to create an index on a collection that has existing data that might have duplicate values for the indexed field, you may choose to combine unique enforcement with duplicate dropping.

 

mongodb

标签:

原文地址:http://www.cnblogs.com/kuipertan/p/4175813.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!