5

The document size increased from 4MB to 16MB, in December 2010. Will it be increased further? If so when?

One work around the size is normalization of the database, by creating more collections, and performing application level joins ( not provided thru MongoDB).

Is there a configuration option available (in MongoDB) which increases limit or provides for a work around?

Suggestions for workarounds around the limit are welcome.

Swagg
  • 1,194
  • 2
  • 14
  • 18
  • possible duplicate of [MongoDB Single Document size limit is 16MB](http://stackoverflow.com/questions/15307800/mongodb-single-document-size-limit-is-16mb) – Amol M Kulkarni Apr 13 '14 at 08:13

2 Answers2

9

There is a JIRA for this: https://jira.mongodb.org/browse/SERVER-5923 but it is listed under features that 10gen are not sure of which means I wouldn't hold your breath.

The docuent size is what it is for a good reason really, namely memory allocation.

If you need more than 16meg you need to seriously consider whether what you are doing is right. MongoDB can do JOINs client side and sometimes you just have to accept that some data is better separate and JOINed in the application. The rule of thumb of always embedding is untrue and incorrect.

Sammaye
  • 43,242
  • 7
  • 104
  • 146
  • 7
    So in short, 16 MB should be enough for anybody! -Bill Gates – Robert Christ Aug 28 '14 at 17:24
  • @RobertChrist when did he say that? – Sammaye Aug 28 '14 at 17:26
  • 4
    Famous myth that in the 1980s Bill Gates said 640KB of memory should be enough for anybody. It appears the mongo devs are now using the same logic. – Robert Christ Aug 28 '14 at 17:28
  • They told me "Hey, start using MongoDB cause is for Big Data" now they say that 16 MB is the limit... why? Im a novice at mongo (2 days ha!), as i understnd a document is like a table, maybe a workaround could be a doc that reference more 16 MB full docs and when that document get full make another document that reference that document and make it infinite. The mongoDB docs say: "MMAPv1 storage engine limits each database to no more than 16k data files. This means that a single MMAPv1 database has a maximum size of 32TB. Setting the storage.mmapv1.smallFiles option reduces this limit to 8TB." – Martin Cisneros Capistrán Oct 30 '16 at 03:17
  • 4
    I think you misunderstood the definition of big data – Sammaye Oct 30 '16 at 08:42
  • The 16 MB limit is not for a good reason, and it is one of the reasons that MongoDB fails entirely by design. – Emil Rosenius May 20 '17 at 17:26
  • @EmilPedersen why would you need more than 16MB unless you are trying to make memory allocation do the impossible in a impossible amount of time? – Sammaye May 20 '17 at 17:27
  • @MartinCisnerosCapistrán I have 50TiB of data in MongoDB, migrated from a relational DB when it was only 20TiB, circa MongoDB 2.2. Thank the Gods for WiredTiger and page compression. "Continuation" markers are totally a thing, though, luckily, on the forums I wrote, the gaming group has yet to write more than 200 chapters (5,000 words per chapter average) worth of replies in a single thread. (Which is what would be required to hit the 16MB limit.) – amcgregor Mar 26 '19 at 16:59
3

Look at GridFS in mongodb. For possible workaround of document size.

No comments on when officially the document size limit will be increased for documents in general in MongoDB.

Sangram Singh
  • 7,161
  • 15
  • 50
  • 79
  • 5
    The problem with gridfs is that it splits one bit of binary data into many bits, also most drivers are only designed to take specifically binary data through this and since this is not a server-side thing you would need to make your own gridfs handler and not only that but querying gridfs documents as you would a normal, larger than 16 meg document, would be difficult if not extremely hard – Sammaye Aug 22 '13 at 08:21