MogileFS module for nginx - sanity check + anyone interested?

Mark Smith smitty at gmail.com
Wed Apr 30 19:44:08 UTC 2008


>  The biggest thing I am wondering is how to map a URL request into a
>  unique MogileFS key that can be created from PHP (or whatever
>  application) - the idea is to have nginx talk to the tracker, then
>  fetch from mogstored and skip needing any application-level (PHP,
>  etc.) interaction.

Well, typically this happens in the application because it is very
domain specific.  For example, LiveJournal has URLs such as this:

   http://userpic.livejournal.com/123/456

Which gets translated into a MogileFS lookup on:

   up:123

You could of course use the URI as the unique identifier and request
"/foo/bar.jpg" and that would work.  The downside to this will be long
key prefixes if you have long paths, which might be an impact on your
database speed of lookups?  (I seem to recall something about MySQL
and key prefixes of certain lengths... but I might be mistaken.)

There is a plugin for using paths that would help here and let you do
this actually, it is somewhat designed for this use case, and you
might be able to drop it in and go.

>  Perhaps some people on this list have some ideas of how to resolve URL
>  -> key, and how to determine the future URL of a file ahead of time so
>  you can generate the key...

Well, if you use the paths plugin, then you just use the URI as the
key and you're done.

>  nginx already has http upstream/proxy support, so it would be very
>  easy once you talk to a tracker and get the file locations, you could
>  probably easily use some nginx proxy code to grab the file right from
>  the specific mogstored...

Cool.  :)


-- 
Mark Smith / xb95
smitty at gmail.com


More information about the mogilefs mailing list