MySQL and MongoDB are open source common database, but MySQL is a traditional relational database, MongoDB is a relational database, also known as a document database, is a NoSQL database. They each have their own advantages, the key is to see where to use. So the SQL (full name structured Query Language) statement that we are familiar with does not apply to MONGODB, because SQL statements are standard languages for relational databases.
Take our project as an example, in the early projects, are using a relational database, used SQLSERVER,ORACLE,DB2, and then all turn to MySQL, the reason is simple: MySQL in good performance, with open source advantage. MySQL's transactional and high performance is our main consideration. Later, because the project to use the user system, that is, there will be a large number of user data to interact-mass storage, MySQL read and write speed will have a little bottleneck, so we think of the recent development of a strong nosql. With the development of the early memcache of NoSQL, there are many non relational databases, such as Redis,mongodb. After a period of testing, Redis and MongoDB read and write speed indeed than MySQL has a clear advantage. The write speed of MongoDB is approximately 2.5w/times per second.
MongoDB is stored in Bson structure (binary), which has obvious advantages to mass data storage. The following is a comparison of MongoDB's operating commands with MySQL.
Especially note: MongoDB Inserts multiple field syntax
> Db.user.insert ({id:1,name: ' Steve ', Sex: ' Male '}) correct
> Db.user.insert ({id:2},{name: ' Bear '},{sex: ' Female '}) error