Serious questions on video streaming from MongoDB

1,112 views
Skip to first unread message

Projapati

unread,
May 20, 2013, 1:30:52 PM5/20/13
to mongod...@googlegroups.com
Hi,
I am about to implement video streaming from my web app.

I have these 3 crucial requirements:
  - Each video will have 2 different files (MP4 H264 encoded + WebM) to cover most browsers in HTML5
  - Streaming must be fast (keeping files in gridFS should not slow down streaming)
  - Storage must scale and easy to backup

Are there any benchmark out there that compares streaming videos from gridFS VS streaming from file system?

Currently I am putting various details (fields) about video in MongoDB collection.
But confused if I should use gridFS to save 2 copies of the video and stream from there VS keep the file in filesystem and stream from there.

Please help me to follow the right path.

Thanks

Kyle Wolfe

unread,
May 20, 2013, 4:18:11 PM5/20/13
to mongod...@googlegroups.com
You are going to lose a little bit of speed reading from GridFS. Your example might be where you want to use Grid FS though. Sharding... Through sharding you might actually see in increase in performance. I do not know of any benchmarks showing this, but it comes down to how you would handle the situation when your video collection becomes larger than what you can store in a single machine. Just googleing for "gridfs vs filesystem" I was able to find a few discussions on the matter.

Projapati

unread,
May 20, 2013, 8:47:00 PM5/20/13
to mongod...@googlegroups.com
I think I am going with gridFS given the long term benefits of sharding, scalability, replication, backup etc.

What is the best way to stream video (large files) out of gridFS?

Thanks

Rob Moore

unread,
May 20, 2013, 10:44:39 PM5/20/13
to mongod...@googlegroups.com

Can you give some details on your environment/language?

Most drivers will have the ability to read and write the chunks via some concept of a stream from the GridFS collections.  

Things like ReactiveMongo and the Asynchronous Java Driver will be able to "push" the chunks/data to the client as it become available.

Rob.

P.S. Full Disclousure: I work on the Asynchronous Java Driver.

Projapati

unread,
May 21, 2013, 2:18:09 AM5/21/13
to mongod...@googlegroups.com
Hi Rob,

I have MVC 3 web app (jquery) and I am using CSharp driver.

What is the most elegant (FASTEST) way to stream videos from mongodb gridFS?

I did some google searching and found few options:

  • gridfs-stream
  • nginx-gridfs
  • gridfs-fuse
  • Export Files From MongoDB GridFS With Directory Paths

Thanks

Projapati

unread,
May 21, 2013, 1:05:49 PM5/21/13
to mongod...@googlegroups.com
Hi Rob,

I have MVC 3 web app (jquery) and I am using CSharp driver.

What is the most elegant (FASTEST) way to stream videos from mongodb gridFS?

I did some google searching and found few options:

  • gridfs-stream
  • nginx-gridfs
  • gridfs-fuse
  • Export Files From MongoDB GridFS With Directory Paths
Thanks

On Monday, May 20, 2013 7:44:39 PM UTC-7, Rob Moore wrote:
Reply all
Reply to author
Forward
0 new messages