MySQL is a relational database.
There are different storage methods on different engines.
The query statement uses the traditional sql statement, with a relatively mature system and a high degree of maturity.
The share of open source databases continues to increase, and the share page of mysql continues to grow.
The efficiency will be significantly slower when processing massive data.
Storage method: virtual memory + persistence.
Query statement: It is a unique Mongodb query method.
Suitable for scenarios: event recording, content management or blog platform, etc.
Architectural features: High availability can be achieved through replica sets and fragmentation.
Data processing: Data is stored on the hard disk, but the data that needs to be read frequently will be loaded into the memory, and the data will be stored in the physical memory to achieve high-speed reading and writing.
Maturity and breadth: emerging databases, low maturity, Nosql database is the closest to relational database, one of the more complete DB, the applicable population is constantly growing.
Quick! In fitThe performance of Mongodb with an order of magnitude memory is very fast. It stores hot data in physical memory, making the read and write of hot data very fast. High scalability, the stored data format is json format!
Does not support transactions, and the development documentation is not very complete and complete.
The main application scenarios of Mysql and Mongodb
1. If you need to use mongodb as a backend db instead of mysql, that is, here mysql and mongodb are parallel, then such use is possible There are several considerations for the following situations: (1) The part responsible for mongodb is stored in the form of documents, which can have good code affinity, and it is convenient to write directly in the json format. (Such as logs) (2) From the datamodels design stage, the atomicityConsidering it, no assistance such as affairs is needed. Development uses languages such as nodejs for development, which is more convenient for development. (3) The failover mechanism of mongodb itself does not need to be implemented in a way such as MHA.
2. Use mongodb as a similar redis, memcache to cache db, provide services for mysql, or back-end log collection and analysis. Considering that mongodb is a nosql database, sql statements and data structures are not as compatible as mysql, and there are many times when mongodb is used as an auxiliary mysql cache db like redis memcache. Or just for log collection and analysis.