In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains the differences and specific application scenarios between mongodb and mysql, which interested friends may wish to take a look at. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn the difference and specific application scenarios between mongodb and mysql.
MySQL
Relational database.
There are different ways of storage on different engines.
Query statement is the use of traditional sql statements, with a more mature system, high maturity.
The share of open source databases is increasing, and the share of mysql pages continues to grow.
The disadvantage is that the efficiency will be significantly slower when dealing with massive data.
Mongodb
Non-relational database (nosql), which belongs to document database. First explain the database of the document, that is, you can store the data of the xml, json, and bson types. These data are self-reporting (self-describing), showing a hierarchical tree data structure. The data structure consists of key-value (key= > value) pairs.
Storage mode: virtual memory + persistence.
Query statement: it is a unique query method of Mongodb.
Suitable for scenarios: event recording, content management or blog platform, etc.
Architectural features: high availability can be achieved through replica sets and shards.
Data processing: data is stored on the hard disk, but the data that needs to be read frequently is loaded into memory and stored in physical memory, thus achieving high-speed reading and writing.
Maturity and extensiveness: emerging database, low maturity, Nosql database is the closest to relational database, one of the more perfect DB, the applicable population is growing.
Advantages:
fast! The performance of Mongodb at the right level of memory is very fast. It stores hot data in physical memory, which makes the reading and writing of hot data very fast.
High expansion!
Its own Failover mechanism!
The storage format of json!
Disadvantages: mainly there is no mechanism of things!
Analyze the Mysql and Mongodb application scenarios
1. If you need to use mongodb as a back-end db instead of mysql, that is, where mysql and mongodb belong to a parallel level, then such use may be considered in the following cases: (1) the part that mongodb is responsible for is stored in document form, can have good code affinity, and the json format is easy to write directly. (such as logs) (2) atomicity has been taken into account from the data models design phase without assistance such as transactions. Developers use languages such as nodejs to develop, which is more convenient for development. (3) the failover mechanism of mongodb itself does not need to be implemented in ways such as MHA.
two。 Use mongodb as a cache db like redis and memcache to provide services for mysql or backend log collection and analysis. Considering that mongodb is a nosql database, sql statements are not as compatible with data structures as mysql, and mongodb is often used as a cache db such as redis memcache, which is used as an auxiliary mysql. Or only log collection and analysis.
At this point, I believe you have a deeper understanding of "the difference and specific application scenarios between mongodb and mysql". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.