- All query writes as much as possible with a time-out
- Bulk interfaces are used when large volumes are written
- Build index as far as possible to specify as background execution
- Indexes are built too much to have a certain effect on write performance, so when you build an index, you have several common fields that cover most of the data. There is a real need to add a few fields that are not covered to create a new index.
- When accessing the replica set, ensure that the MongoDB URI contains all the machines in the replica set for load balancing and high availability.
- When accessing a shard cluster, be sure to include 2 or more MONGOs addresses in the MongoDB URI for load balancing and high availability.
- Combined index field order: Match condition before, range condition behind
- Don't be afraid of data redundancy, but if the data values of a field are often changed, it's less appropriate to be heavily redundant to other documents or other collections.
- I want to add ...
This article is from "Brother Meng, Kahn" blog, please be sure to keep this source http://xjf721.blog.51cto.com/889836/1902035
Some summary of MongoDB usage