this share is shared by MongoDB Greater China technical consultant. "elderly "Come up and ask MONGO what it means, guess the prize, also claiming to be the most cattle of MongoDB experts (in the Kite surfing circle ...) we all know that). I believe we do not know, easy to understand as Mango (English should be mango). Actually MONGO is by this English Hu MONGOus evolved to mean "great".
This share is mainly about the 3.0 version of MongoDB, the performance improvement of the insider decryption. Firstly, the main functions of MongoDB are introduced: (1) automatic replication of high-availability MongoDB has 3 configuration mode: Single-machine, master-slave and copy set (REPLICAT), replication set can realize data read-write separation, and keep the automatic database cluster replication for automatic disaster recovery and high availability. (2) Two-level index, dynamic query MongoDB Two-level index is used BTree (B-tree), the B-tree index is actually the default index for most relational databases. Dynamic query: MongoDB supports rich query expressions. Query directives use a JSON-style tag to easily query inline objects and multidimensional arrays in a document.
(3) Aggregation framework, MapReduce MongoDB's aggregation framework, is to take a series of special operators to a set, can replace the MapReduce, and used in general aggregation operations. (4) Enterprise-class security (5) Geo-Spatial index about LBS related items, usually store the latitude and longitude coordinates of each location, if you want to query nearby sites, you need to build an index to improve query efficiency, MONGODB specifically for such a query to establish a geographical spatial index. (6) GRIDFS,MONGODB file Storage System MongoDB's Gridfs function, performance is not traditional file system high, it is recommended to use the file system to store files, and then use MongoDB to store the file's meta-data. (7) Automatic sharding, horizontal expansion auto-shard support level of the database cluster, you can dynamically add additional machines.(8) document modelA model that stores an object's information in a document. I think that's why MongoDB can't use the Join table query.
MongoDB 2.8(version 2.8jump directly to version 3.0. Why is 2.8 named 3.0? Tang JIANFA means 2.8 has a great boost, with 2.8 a bit wronged, so MongoDB marketing division is named 3.0. )The version begins with the introduction of the Wiredtiger Storage Engine mmap, which supports the Latch-free and non-blocking algorithms. So before you use it, you must addThe wiredtiger parameter. MongoDB3.0 Promotion:(1) Write performance: 7x-10x, increased by 7 to 10 times times the write speed(2) data compression: 30%-80%, which is the 30%-80% of the original data(3) operation and maintenance: 95%, operation and maintenance cost reduction of 95%, mainly concentrated in the clusterheard is: Because of the Wiredtiger storage engine, MongoDB3.0 can have document-level parallel control, even if the processing of frequent write tasks, the database can still maintain a certain degree of stability and predictability of performance.
This 3.0 release, MongoDB official also released a performance test report, this is the first ever official test report MongoDB. Concurrent Volume:
In the YCSB (nosql pressure tool) test, MongoDB3.0 has approximately 7 times times the growth compared to MongoDB2.6 in multi-threaded, bulk-insert scenarios. The second Test compared the 95% read and 5% update scenarios on both systems. You can see that the Wiredtiger has 4 times times more throughput. This performance increase is less noticeable than the pure insert scenario because the write operation accounts for only 5% of all operations. Finally, for scenarios where read-write operations are balanced, you can see that MongoDB3.0 has 6 times times the concurrency rate. This is better than the 4 times-fold improvement of the 95% reading you just saw, as there are more write operations here.
Response Duration:
They compare the 95th and 99th percentiles that update response delays by reading intensive workloads . The update delay in MongoDB3.0 has improved significantly, with a nearly 90% reduction in the 95th and 99th percentiles.
MongoDB2.6 and 3.0 individual document-level concurrency control implementations:version 2.6 uses pessimistic lock, that is, library-level lock (not actually we understand the lock, with lock to describe the feeling is too big too heavy, 2.6 version of the library-level lock should be understood as latch, that is, when modifying the data, will add a light line lock), and 3.0 using the optimistic lock (MVCC) : What is pessimistic lock, optimistic lock? pessimistic Lock: Pessimistic locking assumes the probability that other users are attempting to access or modify the object you are accessing or modifying is very high. So in a pessimistic lock environment, lock the object before you begin to change it, and then release the lock until you commit the changes you made. so the pessimistic lock and lock the time will be longer, this may be a long time to limit the access of other users, that is, pessimistic lock of the concurrent access performance is not good. So the 2.6 version is not going to be the same reason for performance. 2.6 uses the library level lock, the read operation and the write operation is mutually exclusive operation, greatly affected the database overall performance.
The 3.0 version employs optimistic locking:optimistic locking: Optimistic locking is a very small chance that other users will attempt to change the object you are modifying. So the optimistic lock locks the object until you are ready to commit the changes you made. It is shown that optimistic lock and lock time is shorter than pessimistic lock, optimistic lock can obtain better concurrent access performance by using larger lock granularity. This is also one of the reasons for 3.0 read-write performance improvements and high concurrency control.
Of course, there are also needs to be noted:(1) No 32-bit support(2) incompatible with 2.6 data files(3) journal default will not be timely book brush, system downtime, you will lose up to 100MB jouranl data(4) Stall phenomenon will also exist-especially if the IO resources are insufficient(5) Performance metrics on Windows are not as good as Linux
Finally, the MongoDB Community Tutorial is available:Chinese Community: http://www.mongoing.comOnline Tutorial: http://university.mongodb.com
2015 China Database Conference MONGODB Share