In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
MongoDB logical structure
It consists of three parts: document, collection and database.
MongoDB document: The basic unit of data in mongodb, equivalent to a row of records in a relational database. Each document has a special key "_id", which is unique in the collection to which the document belongs.
Collection: A concept equivalent to tables in relational databases.
The hierarchical structure of document, collection and database is as follows:
Document corresponds to row in relational data
A collection corresponds to a table in relational data.
database corresponds to relational database
The MongoDB data directory stores all MongoDB data files
[mongo@xxxx-xx-xx data]$ ll Total Usage 1212436drwxr-xr-x. 2 mongo dbmon 69 Oct 28 17:15 diagnostic.datadrwxr-xr-x. 2 mongo dbmon 27 Oct 28 15:25 journal-rw-----. 1 mongo dbmon 67108864 Oct 28 15:25 local.0-rw-----. 1 mongo dbmon 1073741824 Oct 28 17:15 local.1-rw-----. 1 mongo dbmon 16777216 Oct 28 17:14 local.ns-rw-r--r--. 1 mongo dbmon 6 Oct 28 15:17 mongod.lock-rw-r--r--. 1 mongo dbmon 69 Oct 28 15:17 storage.bson-rw-----. 1 mongo dbmon 67108864 Oct 28 17:00 sykdb.0-rw-----. 1 mongo dbmon 16777216 October 28 17:00 sykdb.nsdrwxr-xr-x. 2 mongo dbmon 6 Oct 28 15:54 _tmp
Inside MongoDB, each database contains a.ns file and a number of data files, such as local.ns,local.0,local.1, the number of files increasing as the data volume increases.
Each table has a namespace, and each index has a namespace. Metadata for these namespaces is stored in *.ns files.
MongoDB has an internal mechanism for pre-allocating space, pre-allocated files are filled with zeros, so mongodb always keeps extra space and spare data files. Each time a new data file is generated, it is twice the size of the previous data file. For example, local.0 is 67108864, local.1 is 1073741824
Reference: mongodb family-architecture
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.