Summary of the advantages and disadvantages of MongoDB and MySQL

Compared with relational databases, the advantages of MongoDB: ①Weak consistency (eventually consistent), which can better guarantee the user’s access speed: For example, in a traditional relational database, a COUNT operation locks the data set so that the exact value in the “current” situation is guaranteed. This in some cases, such as For example, it is very important to check the account information through ATM, but for Wordnik, the data is constantly updated and growing. Late. What they need is an “approximately” number and faster processing speed. But in some cases MongoDB will lock the database. If there are hundreds of requests at this point, they can pile up and cause a lot of problems. We use the following optimization to avoid locking: Before each update, we will first query the records. Query operations place objects in memory, so updates are as fast as possible. In a master/slave deployment scenario, the slave nodes can be run with the “-pretouch” parameter, which also achieves the same effect. Use multiple mongod processes. We split the database into multiple processes based on access patterns. ②The storage method of the document structure can obtain data more conveniently. For a hierarchical data structure, if such data…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索