We have a service will collect data and call api to save to a mongodb's collection name alldata

And the problem is ,it keeps write data frequently,then the mongo will shutdown (I found on internet said the collection limit is 16mb)

So we have to delete the old data by hour
But I want to keep the old data at least one week
How to design this ??

should we use many collections to save?? If we use many collections,how to query many of them??
Or should we back up ?

I heard that mongodb is appropriate to bigdata,but I don't know how people usually use it ?
Please give me some advice Thank you.


The limit is not on the collection size, but on the document size. There are ways that you can store the document of a higher size.

Having very large Documents will surely affect the performance of the MongoDB. You can surely split these documents into multiple documents in the same Collection.

For example, You can divide the Documents to be stored Date wise, I mean, if you were writing all the data related to some X constraint into a document, then split it into X Constraint, Date 1 as one document, X Constraint, Date 2 into a different document. You can split in any logical way you feel is right for your Database design.

Or if you Document is very granular in nature and can't be split, then you have 3 options
1. Use Mongo's GRID FS
2. a relational approach to store the part of the data in a different Collection
3. Depending on the number of reads, number of writes and the size of the Document, choose the best possible NoSql Solution.

If you need a more specific answer, please update the question with relevant details.

| improve this answer | |
  • +1 for clarification of limit on document not collection. – Derek Downey Dec 17 '15 at 13:34

Not the answer you're looking for? Browse other questions tagged or ask your own question.