Storing (small) Images in MongoDB
5 stars based on
Let's explore a simple alternative. Raw image data is neither structured nor searchable anyway, so flat files will do just as well as a database, with less overhead.
This eliminates two of the three round-trips to the database and increases the amount of required RAM only marginally, as long as images are reasonably small. This might not be the best approach for storing large images, but for your typical user thumbnail, it's certainly a viable alternative.