1

Using MongoDB 3.0.7 as the primary datastore. I connect to it using ReactiveMongo 0.11 on a JVM-based language.

My question is: how well does Mongo store multi-dimensional arrays? For image analysis, I'm storing multiple images in the form of Array[Array[Double]]. There will be 60 images in a single document, each around 250px width and height.

Is this array structure sufficient enough, or do I need to rethink my schema?

  • 1
    I would like to add that storing multiple images into a single document might not be the best idea when it comes to scalability. I'd rather put each image into a single document and have a field which connects them by a common denominator, like a username. Given the size of the images, the transfers will take longer than the lookup, anyway. – Markus W Mahlberg Nov 24 '15 at 8:45
  • @MarkusWMahlberg you ended up being right on this since I ran into several issues. Although this wasn't an easy solution, it was the necessary one. Luckily, ReactiveMongo returns futures and I can also mix some multi-threading into the process. – crockpotveggies Dec 6 '15 at 23:58
2

MongoDB can efficiently store these images provided their total size does not exceed the 16MB document limit. If you are likely going to this, you should consider redesigning your schema, otherwise your schema design will be fine.

|improve this answer|||||
  • I don't expect the total size to exceed 5MB. Perfect, thanks for your help! – crockpotveggies Nov 24 '15 at 1:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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