In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article shows you how to use the inMemory storage engine in MongoDB. The content is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
I. Overview of MongoDB storage engine
Storage engine (Storage Engine) is the core component of MongoDB, which is responsible for managing how data is stored on hard disk (Disk) and memory (Memory). Since MongoDB 3.2, MongoDB supports multiple data Storage engine (Storage Engine), and MongoDB supports WiredTiger,MMAPv1 and In-Memory. Starting with MongoDB 3.2, WiredTiger has become the default Storage Engine for MongDB and is used to persist data to hard disk files. Currently, MongoDB supports the following three storage engines:
WiredTiger:WiredTiger provides concurrency control at the document level (Document-Level), checkpoint (CheckPoint), data compression and local data encryption (Native Encryption). Starting with MongoDB 3.2, WiredTiger has become the default Storage Engine for MongDB.
MMAPv1: prior to MongoDB 3.2, MMAPv1 was the default data storage engine.
The In-Memory Storage Engine:In-Memory storage engine stores the data in memory. Except for a small amount of metadata and diagnostic (Diagnostic) logs, the In-Memory storage engine does not maintain any data stored on the hard disk (On-Disk Data), avoiding the IO operation of Disk and reducing the delay of data query.
II. In-Memory Storage Engine
The In-Memory storage engine stores the data in memory. Except for a small amount of metadata and diagnostic (Diagnostic) logs, the In-Memory storage engine does not maintain any data stored on the hard disk (On-Disk Data), avoiding the IO operation of Disk and reducing the delay of data query.
Use the following statement to specify the In-Memory storage engine:
Mongod-storageEngine inMemory-dbpath
Description:
About the-- dbpath parameter: although the In-Memory storage engine does not write data to the file system, it needs to use-- dbpath to maintain a small amount of metadata and diagnostic (Diagnostic) logs.
About memory usage:-- inMemorySizeGB sets the amount of memory consumed. The default value is 50% of RAM-1GB. Specifies the amount of memory data, in GB, used by the In-Memory storage engine.
About persistence: because the In-Memory storage engine does not persist the data, it only stores the data in memory, and the read and write operations are completed directly in memory, and the data will not be written to the Disk file, so there is no need for separate log files, and there is no problem of logging and waiting for data persistence. When the MongoDB instance shuts down or the system terminates abnormally, all data stored in memory will be lost.
The startup process is shown in the following figure:
The above is how to use the inMemory storage engine in MongoDB. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, 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.
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.