I'm going to migrate a SQL Server database to MongoDB. I have multiple tables with a lot of data. I would like to know if is possible to break the single mongo db file into multiple files one for each collection in Mongo.
Asked
Active
Viewed 1,950 times
1 Answers
2
There is no single mongodb data file. mongodb will allocate the initial file for the database and then add files as needed. On my Mac as currently configured it starts with a 64MB file, then the next is double that size (128MB) and doubles the next one etc till it get's to 2GB and then all files after that will be 2GB in size.
you can modify that with various configuration options http://docs.mongodb.org/manual/reference/configuration-options/ but keep in mind storage file allocation is per database, not collection.

John Petrone
- 26,943
- 6
- 63
- 68
-
I have a bit more detail on file size options in [this](http://stackoverflow.com/a/10001832/272109) StackOverflow answer. – David Makogon Apr 24 '14 at 00:23
-
When you start mongod from a shell you specify the --dbpath. That is for the complete DB. So it is not possible to specify for a single collection? Is there another way to partition the database like SQL Server? – JoseCarlos Apr 24 '14 at 14:10
-
Files are allocated per database, not per collection. – John Petrone Apr 24 '14 at 15:11