I am new to MongoDB.I looked inside dbpath I found
users.0 - 16.8MB
users.1 - 33.6MB
users.ns - 16.8MB
Further when I dig deeper I found,
The .0, .1 files are datafiles. Each datafile is preallocated to a particular size. (This is done to prevent file system fragmentation, among other reasons.) The first filename for a database is .0, then .1, etc. .0 will be 64MB, .1 128MB, et cetera, up to 2GB. Once the files reach 2GB in size, each successive file is also 2GB. The ".ns" files are namespace files. Each collection and index would count as a namespace. Each namespace is 628 bytes, the .ns file is 16MB by default.Thus if every collection had one index, we can create up to 12,000 collections. The --nssize parameter allows you to increase this limit
But I when I started comparing MySQL with I figured out if you specify
innodb_file_per_table = true/1
But I cannot find any option for MongoDB to create separate file to each collection.
Does MongoDB only creates datafiles(.0, .1) which will contain all the collection?
Or
Is there any way to tell MongoDB to create separate files for each collection?
Your kind help and precious time would be highly appreciated