Re: Mongodb version 3+ filestructure is different to previous versions

From: Lyn Ko <lyn.duong@xxxxxxxxx>
To: "mongodb-user@xxxxxxxxxxxxxxxx" <mongodb-user@xxxxxxxxxxxxxxxx>
Date: Sat, 30 Apr 2016 15:04:02 +1000
Why ads?
Thanks Kevin for taking time to reply

I also found the Config setting storage.directoryPerDB...was able to group
all the files per db using this which was good



On Friday, 29 April 2016, Kevin Adistambha <kevinadi@xxxxxxxxxxx> wrote:

Hi Lyn,

I have Mongodb 2.6 version installed on server and the physical file for
each database consists of
databasename.0
databasename.1
databasename.2 …
and 1 .ns file
databasename.ns

These are MMAPv1 <https://docs.mongodb.org/manual/core/mmapv1/> physical
files. The MMAPv1 storage engine was the default (and only) storage engine
for MongoDB version 2.6.x.

I’ve now got another database server with 3.2 installed and noticed the
filestructure is completely different.
The files i can see are a bunch of collection-nn-nnnnnnnnnnnnnnnn.wt and
index-nn-nnnnnnnnnnnnnnnnnnnnnn.wt files.

These are WiredTiger <https://docs.mongodb.org/manual/core/wiredtiger/>
physical files, which is currently (as per MongoDB version 3.2.x) the
default storage engine employed by MongoDB.

Is there a configuration or parameter to set so that the filestructure
contained by database??

No. The file structure is determined by the selected database storage
engine and cannot be changed. I would also strongly discourage copying
individual files between dbpath (especially on a running mongod instance)
as this will likely introduce data corruption.

If you need to copy one database to another server, you might want to take
a look at the db.copyDatabase()
<https://docs.mongodb.org/manual/reference/method/db.copyDatabase/>
command instead.

Also, there are many advantages of using WiredTiger compared to MMAPv1,
such as:

   - Document level concurrency
   - Better multithreaded performance
   - Compression
   - MultiVersion Concurrency Control to ensure data consistency

Unless you have a very specific need for MMAPv1 features, I would
recommend you to use the WiredTiger storage engine instead due to
WiredTiger’s generally better performance, concurrency abilities, and
compression capabilities. Also, MMAPv1 files may be larger compared to the
actual data size, due to storage padding and fragmentation
<https://docs.mongodb.org/manual/core/mmapv1/#record-allocation-strategies>
.

Best regards,
Kevin


--
You received this message because you are subscribed to the Google Groups
"mongodb-user"
group.

For other MongoDB technical support options, see:
https://docs.mongodb.org/manual/support/
---
You received this message because you are subscribed to a topic in the
Google Groups "mongodb-user" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/mongodb-user/cRz6jrl-UFU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
mongodb-user+unsubscribe@xxxxxxxxxxxxxxxx
<javascript:_e(%7B%7D,'cvml','mongodb-user%2Bunsubscribe@xxxxxxxxxxxxxxxx');>
.
To post to this group, send email to mongodb-user@xxxxxxxxxxxxxxxx
<javascript:_e(%7B%7D,'cvml','mongodb-user@xxxxxxxxxxxxxxxx');>.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit
https://groups.google.com/d/msgid/mongodb-user/bf793ec2-2965-4dc3-9273-ea5e217943d1%40googlegroups.com
<https://groups.google.com/d/msgid/mongodb-user/bf793ec2-2965-4dc3-9273-ea5e217943d1%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.

For other MongoDB technical support options, see: https://docs.mongodb.org/manual/support/
--- 
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe@xxxxxxxxxxxxxxxx.
To post to this group, send email to mongodb-user@xxxxxxxxxxxxxxxx.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/CAAZLcbDxiOUQ22xjXbvwRgzkj8UW7D9n3cPvgCb7pWWkZD9aFA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Why ads?