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?

2
  • 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. Nov 24, 2015 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. Dec 6, 2015 at 23:58

1 Answer 1

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.

1
  • I don't expect the total size to exceed 5MB. Perfect, thanks for your help! Nov 24, 2015 at 1:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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