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…