GridFS versus CDN

905 views
Skip to first unread message

sdotsen

unread,
Feb 27, 2010, 11:05:14 PM2/27/10
to mongodb-user
I have to find the blog post but there was one that had a benchmark
showcasing various implementation of gridfs including one against S3/
Cloudfront. ANyways, I'm more concern with how to implement gridfs
correctly. Right now I display my pictures by pulling the chunks
directly out of mongodb (via gridfs' tutorial). The post shows an
example using nginx plugins along with another plugin that mounts the
DB, hence, you're able to call the files directly using filename
conventions.

With that said, how much of a strain would it put on the DB if I
continue to do things the way I am now. Should I look into a plugin?

Eliot Horowitz

unread,
Feb 27, 2010, 11:09:19 PM2/27/10
to mongod...@googlegroups.com
Well first, I wouldn't say its GridFS vs. CDN, GridFS often makes
sense with a CDN in front of it for example.
businessinsider.com stores/manipulates/manages images in GridFS and
serves them directly, but has a CDN in front of it as well.

Whether you serve directly or through a plugin just depends on the
performance of your implementation.
What language is your code written in? The plugin is important if
you're writing in a possible less performance language and the plugin
can bypass that and be really fast.

> --
> You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
>
>

sdotsen

unread,
Feb 27, 2010, 11:16:11 PM2/27/10
to mongodb-user
I'm using PHP to code my sites. When you say "CDN in front of it..."
you mean something like putting my environment on EC2 and using
Cloudfront?
I'm not all too familiar with CDN and all I hear is Amazon this and
Amazon that. If the environment is on a VPS, I wasn't sure how a CDN
fit into all this w/o
giving up my data to them.

Yea, the title was misleading, sorry about that. :-)


On Feb 27, 11:09 pm, Eliot Horowitz <eliothorow...@gmail.com> wrote:
> Well first, I wouldn't say its GridFS vs. CDN, GridFS often makes
> sense with a CDN in front of it for example.
> businessinsider.com stores/manipulates/manages images in GridFS and
> serves them directly, but has a CDN in front of it as well.
>
> Whether you serve directly or through a plugin just depends on the
> performance of your implementation.
> What language is your code written in?  The plugin is important if
> you're writing in a possible less performance language and the plugin
> can bypass that and be really fast.
>

Eliot Horowitz

unread,
Feb 27, 2010, 11:20:30 PM2/27/10
to mongod...@googlegroups.com
Often, the way a CDN will work is basically as a proxy for your content.

So a browser will request cdn.foo.com - which goes to the CDN. If the
CDN has the image, it'll serve it.
If not - it'll make a request to www.foo.com and cache it.

See: http://www.us.cdnetworks.com/service/web_application_acceleration.php

S3 + CloudFront is storage + CDN.

Dwight Merriman

unread,
Feb 28, 2010, 1:08:44 PM2/28/10
to mongod...@googlegroups.com
i think amazon's cdn uses S3 as the "origin"

a lot of others like CDNetworks, Akamai etc. support using an origin
http server for cache misses. GridFS + a web/app server make a good
origin.


On Sat, Feb 27, 2010 at 11:16 PM, sdotsen <samna...@gmail.com> wrote:

sdotsen

unread,
Feb 28, 2010, 1:51:35 PM2/28/10
to mongodb-user
Thanks guys and yes, Cloudfront uses S3 as the "source."
This kinda reminds me of memcache no? Except you have a third party
that serves the files, hence alleviate one's bandwidth/load?


On Feb 28, 1:08 pm, Dwight Merriman <dwi...@10gen.com> wrote:
> i think amazon's cdn uses S3 as the "origin"
>
> a lot of others like CDNetworks, Akamai etc. support using an origin
> http server for cache misses.  GridFS + a web/app server make a good
> origin.
>

Eliot Horowitz

unread,
Feb 28, 2010, 1:54:16 PM2/28/10
to mongod...@googlegroups.com
Similar, but in addition to reducing load on your primary servers,
CDNs are generally geographically distributed so total user response
time is much lower.
Reply all
Reply to author
Forward
0 new messages