Topic: Rails framework architecture problem

Hi programmers,

I started working on a project, Rails 3.1.3 application, where the user can upload video and audio files. Till now the uploaded files are stored in /public folder. I know this is not good, since every user uploads videos there (up to 100 MB in size) and the application becomes huge in size. What will be a smart solution to this problem - to store the videos on another web server/ file server?

Thanks in advance

Re: Rails framework architecture problem

Paperclip or attachment_fu plugin

Re: Rails framework architecture problem

Yes, sure, but I meant if it is alright to store such big files in the public folder of Rails app? For example, when using File storage option of attachmen_fu plugin.

Re: Rails framework architecture problem

I'd look at this considering the entire stack of software involved

1) Rails - pretty much doesn't care what you do in the public directory, rails assumes the Public directory is there more for Apache or whatever web server you are using.

2) Apache or whatever,  - almost the same answer for the Rails layer.  You might want to peruse for Apache plugins that address the needs of very large filesystems,  but since that is pretty in much the realm of the OS involved, that's where you want to be concerned.

3) The OS.  Now if it were me, and I knew the Public directory could get extremely large,  I'd deploy the app at Joyent, because they use Solaris, and Solaris has the XFS filesystem,  and Solaris is more stable and solid than most of the Linux out there.  I'm not sure, but I believe Joyent can arrange for some special hardware and mount it up as XFS, get it backed up for you,  etc.

Joe got a job, on the day shift, at the Utility Muffin Research Kitchen, arrogantly twisting the sterile canvas snout of a fully charged icing anointment utensil.

Re: Rails framework architecture problem


Re: Rails framework architecture problem

Also consider using external storage for assets, suh as amazon or unlimited web hosting uk and make use of Rails asset_host functionality.

This will have the added advantage of dramatically improving performance of your app - read more here … elper.html

What you want and what you need are too often not the same thing!
When your head is hurting from trying to solve a problem, stop standing on it. When you are the right way up you will see the problem differently and you just might find the solution.
(Quote by me 15th July 2009)