Can I serve media to web browser from MongoDB
I will try to keep this simple without lots of extra information. I have
been investigating MongoDB and I believe it will work well for my next
project. There is one thing I am fuzzy about though: storing and
retrieving files (chunks) from GridFS.
Lets take a CMS for example. If I wanted to display (output via the
browser) an image, I would go my MySQL database, find the key and pull the
metadata that would include the file source on the File System and then
display an image tag with that href. I know that I can store
image/video/etc files in Mongo beautifully and I can retrieve binary, but
if I wanted to display that file (push it to the browser) would I have to
write the contents to a temporary file and then echo my img tag with the
href? That can't be more efficient.
I feel like I'm missing something. For this circumstance, is MongoDB any
better?
For clarification: I'm using PHP and Apache on a typical LAMP stack
(development not production) and working on a platform to enable creative
collaboration between artists. So, I would have several artists
collaborating on the same files, and I would like to be able to search
inside those files, index them, keep all metadata together and employ
sharding. I really seems like MongoDB is the way to go.
Thanks!
Michael
No comments:
Post a Comment