[Mongrel] MogileFS handler

Zed A. Shaw zedshaw at zedshaw.com
Thu Nov 2 17:03:19 EST 2006

On Thu, 02 Nov 2006 10:32:15 +0100
Philippe Jayet <hip at lan-attack.ch> wrote:

> Hello,
> I've been using NFS for sharing files across a cluster of servers but
> I've had a lot of problems with that. I'm planning to move to MogileFS
> which seems to be more stable and more adapted to this usage (lots of
> user uploaded files).
> I wonder if someone has already worked on an integration of MogileFS
> into Mongrel (and Rails app) for serving the files ? If not, I think of
> writing a handler that would act as a bridge between the MogileFS keys
> and the actual files.
> I could use Perlbal from Danga but it involves a new technology (Perl)
> and a new setup.

Yep, this is totally possible depending on how you need to use it.  If you just need to serve files out of mogilefs then look at the FUSE adapter and have your main web server do the work using either x-sendfile or plain old a-href.  (many others mentioned this)

If you're looking to do the upload and download with a bit of smarts behind it, then you're looking at doing a Mongrel handler or even set of Mongrel handlers.  There's plenty of great examples you can leverage with Rick's mongrel_send_file and Ezra's merb stuff as examples.

And of course, I'll pimp the book since it covers writing Mongrel handlers and how Mongrel is designed. :-)  http://safari.oreilly.com/0321483502

Good luck, and when you do it, try to open source it since others will probably like something like this.

Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu
http://safari.oreilly.com/0321483502 -- The Mongrel Book
http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help.

More information about the Mongrel-users mailing list