Hi Mikel,
Thanks a lot for your advice.
I have one more question... i.e.
The music/videos will be copyrighted stuff... and we want the users to be able to only listen/watch those on the website and not download them (unless ofcourse, if it is available for free download from the owner). So, if these files are not server through Rails app, then how should I control/restrict the download access?
Main Topics
Browse All Topics





by: raasdnilPosted on 2009-01-17 at 00:20:13ID: 23399985
But, here are my ideas...
I run several RoR websites with video and audio streaming. We do all our stuff in house, but in hindsight, I would have used one of the companies, such as EnginYard (no, I don't get any commission... shame)...
So each of your questions:
1. What are the steps from the application design/architecture point of view that should be followed for scaling the Rails application with this kind of user load?
Rails scales, as long as you know what you are doing. Some of the things you want to look at is avoid having rails serve any of the file content. You want to take advantage of Apache's X-Sendfile directive or similar in the other web servers. Serving large static files from Ruby on Rails will just tie up your web server and cause all sorts of problems, aside from being slow, also, when RoR sends a file, it sends it in 4k chunks... but loads the whole file into RAM first... OK for a small file... but scary for a 400mb video file...
You want to keep your large files out of the database, just keep pointers to file system resources. File systems are a custom built and highly efficient database for... files! Use them.
Aside from that major bugbear, the rest of your site is probably going to be quite easy in Rails. I wouldn't stress too much about caching and performance until you get closer to launch. Good use of Active Support's cache action, page and fragment methods should get you by for most of it.
2. How to address scalability for application having streaming content?
This is where you want to hook up with someone like EnginYard. Seriously, they do this for a living and seem like they know what they are doing. You can get a developer account and start staging and setting up the environment.
3. How should I plan for scalability at the Hardware Level (for both Rails app and streaming)?
Again, see #2. I would off load this problem elsewhere.
Regards
Mikel