Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to develop a document-oriented database system MongoDB

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

In this issue, the editor will bring you about the document-oriented database system MongoDB, which is rich in content and analyzed and described from a professional point of view. I hope you can get something after reading this article.

Document-oriented database system MongoDB details, MongoDB is a document-oriented database system. Written in C++, does not support SQL, but has its own powerful query syntax.

MongoDB uses BSON as the format for data storage and transmission. BSON is a JSON-like binary serialization document that supports nested objects and arrays.

1. MongoDB is very similar to the row,collection of MySQL,document corresponding to MySQL and the table application scenario of MySQL:

1. Website data:

Mongo is very suitable for real-time insertion, update and query, and has the replication and high scalability required for website real-time data storage.

2. Cache:

Due to its high performance, mongo is also suitable as a cache layer for information infrastructure. After the system is rebooted, the persistence cache built by mongo can avoid the overload of data sources in the lower layer.

3. Large-size, low-value data:

It may be expensive to store some data in a traditional relational database. Before that, many programmers often chose traditional files for storage.

4. Scenarios with high scalability:

Mongo is ideal for databases consisting of dozens or hundreds of servers.

5. Storage of objects and JSON data:

The BSON data format of mongo is very suitable for the storage and query of document format.

6. Important data:

Mysql, General data: mongodb, temporary data: memcache for relational data tables, mongodb provides a faster view view;, while for PHP programs, mongodb can be used as a persistent array, and this persistent array can also support sorting, conditions, restrictions, and other functions.

Second, to replace part of the functions of mysql with mongodb, one of the main thinking points is to regard mongodb as a view (view) of mysql. View is the key to integrate table data into business data. For example, to report the original data, it is necessary to first count the original data and then generate view, and then query and report the view. Unsuitable scenarios:

1. Highly physical systems, such as banking or accounting systems. At present, the traditional relational database is more suitable for applications that require a large number of atomic complex transactions.

2. Traditional business intelligence applications: BI databases for specific problems will produce highly optimized query methods. For such applications, data warehouse may be a more appropriate choice.

3. Problems that need SQL

4. Important data, relational data

Advantages:

1) weak consistency (final consistency), which can better ensure the access speed of users

2) the storage mode of the document structure, which can obtain the number more easily.

3) built-in GridFS for efficient storage of binary large objects (such as photos and videos)

4) support replication set, active / standby, mutual active / standby, automatic slicing and other features.

5) dynamic query

6) full index support, extended to internal objects and embedded arrays

Disadvantages:

1) transactions are not supported

2) MongoDB takes up too much space and the maintenance tools are not mature enough

The above is the editor for you to share how to document-oriented database system MongoDB, if you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report