0

Does document size matter when updating (pushing new item) into some nested array in that document?

I mean, I have document with historical data and I know, that some days this document will be charged with new items very often. So should I split this document to "historical data" and "today data" documents?

Reading is not so frequent as update operation in this case. For example 700 updates while 20 reading per day.

vaclav_o
  • 1,705
  • 3
  • 15
  • 24

1 Answers1

0

Adding new document will move the document in the disk if there is to adjust it self which will make it slower. As you are reading very less , I think it will be OK. If they outgrow their space, they must be moved on the disk to a larger area. Creating the document with extra padding so that in case you insert , it will be OK. http://docs.mongodb.org/manual/core/record-padding/

Devesh
  • 4,500
  • 1
  • 17
  • 28
  • Thanks for answer! Padding is definetely right suggestion, but I want to rather know if size of existing document has some impacts to update operation - does mongo load it all to RAM while updating and then saves all document to disc? – vaclav_o Aug 23 '13 at 18:07
  • As per my understanding yes. http://stackoverflow.com/questions/4667597/understanding-mongodb-bson-document-size-limit – Devesh Aug 24 '13 at 02:32