mongodb还有分表的必要吗?
天蓬老师
天蓬老师 2017-05-02 09:26:37
0
4
1733

mongodb自带了autosharding,那么还有必要分表吗,加入一张表过亿级别?

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(4)
给我你的怀抱

Well, I downvoted it because this answer is misleading readers.
No matter what kind of database, the cost of creating an index is huge, because it means traversing the data in the entire table, how can it be possible without a lot of pressure? That’s why there are {background: true} options that can appropriately alleviate this situation. When creating an index in a cluster that is under too much pressure, we recommend using the "rolling" index creation method, which removes the nodes one by one to create the index and then puts it online to avoid affecting the operation of the online system.
As for the lock issue, starting from 3.0, the WT engine supports document locks (row locks).
The cost of querying the index is huge. It is probably because your index is not established properly. You can give specific examples to discuss.
When the data exceeds 100 million, please give specific examples to discuss the pitfalls.

Peter_Zhu

Mongodb supports automatic sharding and partitioning architecture, which can be used to build a horizontally scalable database cluster system and store database tables on each sharding node.

Please see mongodb sharding instead of database sharding [1]: https://yq.aliyun.com/article...

给我你的怀抱

Tables can be divided by month Name_03 Name_04 The name remains unchanged. The name of the table to be queried is dynamically changed according to the timestamp in the program

PHPzhong

I personally think it is still necessary. MongoDB has the problem of locking the database (lower version) and locking the table (medium version). Even if there are shards for storing files, the overhead of index creation and index search is still huge! ! ! ! When the data exceeds 100 million, there are still many pitfalls!

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!