In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article is to share with you about the usefulness of MongDB. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
1. What is NoSQl?
NoSQL:Not Only SQL, in essence, is also a database technology. Compared with traditional database technology, NoSQL does not follow some SQL constraints, such as:
1.1SQL standard: the sql standard followed by select * from table_name update table_name set delete from table_name and other relational data such as traditional relational databases (Oracle, Mysql,DB2).
ACID characteristics of transactions: a (Atomicity atomicity) C (Consistency consistency) I (Isolation isolation) D (Durability persistence)
1.3Table structure, etc. (there is no so-called table structure in NoSQL)
2. Advantages of NoSQL:
2.1 to meet the high concurrency of reading and writing to the database (the first performance bottleneck in an application is the DB layer. Generally, the concurrency that Mysql can support is about 300 on machine hard disk and 700 on solid-state disk. Therefore, it is easy to break through the performance bottleneck of the database in high concurrency scenarios, and the user experience of relational databases is poor in terms of high concurrent read and write performance, or when the concurrency is large to a certain amount, it directly leads to database crash)
2.2 funny storage and access to massive data (in traditional relational databases, the user experience is very poor when the single-table data exceeds 7 million. When the amount of data is large to a certain extent, you need to consider sub-database, table partition, read-write separation, cluster and other means to ensure the performance of the database. The maintenance cost of horizontal or vertical expansion of traditional relational database is higher, and the processing of distributed transactions is more difficult)
2.3 High scalability and high availability of databases (it is easier to scale horizontally and cluster than traditional relational databases)
2.4 flexible data structure to meet scenarios where the data structure is not fixed (traditional relational databases have a fixed table structure when the requirements change frequently and the data structure is uncertain, new requirements often lead to changes in the table structure due to changes in the table structure, or the modification of the table structure that affects the whole body cannot meet the new requirements.)
3. Disadvantages of NoSQL:
Transactions are generally not supported. Even though some NoSQL already support transactions such as Redis,MongoDB, their transactions are weakly consistent transactions, which are not as good as relational databases in terms of integrity and rigor of transaction support.
3.2 it is difficult to implement complex SQL queries (for example, it is difficult to implement report queries with various aggregate functions related to multiple tables in traditional relational databases using NoSQL)
3.3 the threshold for data maintenance of operation and maintenance personnel is relatively high (at present, operation and maintenance personnel are good at maintaining relational databases, but they still need to learn to maintain NoSQL databases)
3.4 at present, it is not the mainstream database technology (the mainstream database technology is still relational database)
4. NoSql database classification
5. The basic concept of Mongodb
At present, Mongodb ranks first in NoSql database, so it is very necessary to learn Mongodb.
Mongdb: is a database, high-performance, schemaless, document-based NoSQL database, is currently the most popular database in NoSQL, open source products, NoSQL is the most feature-rich and most like relational database NoSQL database
Properties:
5.1 Storage for collection documents: suitable for storing data in the form of Bson (an extension of json)
5.2 the format is free, the data format is not fixed, and modifying the structure in the production environment does not affect the operation of the program.
5.3 powerful query API, object-oriented query language, basically covering all the functions of sql language
5.4 complete index support, support for query plans
5.5 support for replication (master-slave) and automatic failover (highly available single point of failure)
5.6 supports funny storage of binary data and large objects (files)
5.7 using sharded clusters to improve system scalability
5.8 using a memory-mapped storage engine to convert physical IO operations on the hard disk into memory operations to improve read and write performance but eat memory
6. Diagram of basic concepts of Mongodb
7. Comparison between MongoDB concept and RDMS concept
8. How to decide whether a business scenario needs to use MongoDB
There is no business scenario that can only be solved using Mongodb, and all those that can be solved with Mongodb can be solved with relational database, but when you choose to use Mongodb to make the cost of solving a problem or business scenario lower, you can consider using Mongodb. The cost of solving the problem includes (learning cost, development cost, operation and maintenance cost, etc.)
If the first yes is denied, it is not recommended to use mongodb. If the first must meet the requirements of yes, any one or more of the remaining options can be used mongodb, the more items satisfied, the more advantages of mongodb can be reflected.
9. MongoDB usage scenarios
Mongodb has been applied to various fields of computer software, such as games, logistics, e-commerce, content management, social networks, Internet of things, live video, etc.
9.1 Game scenario: use Mongodb to store game user information, user equipment, points and other directly embedded documents to facilitate query and update
9.2 Logistics scenario: Mongodb is used to store product comments and order information. The order status is constantly updated during delivery and stored in the form of an Mongodb embedded array. All the changes of the order can be read in a single query.
Social scenarios: use Mongodb to store user information and moments information posted by users, and find nearby people, service places and other functions through geographic location index
9.4 Internet of things scenario: use Mongodb to store all connected device-only information, as well as log information reported by devices, and analyze these information in multi-dimensions
Live video streaming: use Mongodb to store user information, gift information, etc.
10. MongoDB cannot be used in those business scenarios
10.1 highly transactional systems, such as banking systems, financial systems, payment systems, etc., are required because of the weak integrity and rigor of Mongodb's support for transactions
Traditional business intelligence applications: problem-specific data analysis, multi-data entity association (multi-table join operations) involving complex relational query report systems, highly optimized query systems
10.3 it is convenient to use sql, and it is not recommended to use Mongodb when the data structure is relatively fixed.
Thank you for reading! This is the end of this article on "what's the use of MongDB?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
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.