# Cost model for a RoR where users could upload lots of file? what approach?

**URL:** <https://www.ruby-forum.com/t/cost-model-for-a-ror-where-users-could-upload-lots-of-file-what-approach/176175>\
**Category:** Rails\
**Created:** [September 25, 2009, 8:00pm UTC](https://www.ruby-forum.com/t/cost-model-for-a-ror-where-users-could-upload-lots-of-file-what-approach/176175 "2009-09-25T20:00:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [September 25, 2009, 8:00pm UTC](https://www.ruby-forum.com/t/cost-model-for-a-ror-where-users-could-upload-lots-of-file-what-approach/176175/1 "2009-09-25T20:00:48Z")

</div>

Hi,

Any ideas/suggestions re what a good cost model / approach would be if  
one’s Ruby on Rails application was to be successful, but noting users  
(as part of the service/application) could upload lots of files  
(images etc).

What’s a good way of have:  
(a) a simple cost model for use of the site, e.g. free up to X but  
costs Y after this per every Z,  
(b) noting files/images etc have to be protected by the rails  
authentication / authorization  
© makes sure I won’t start losing money (e.g. if users have to pay  
less than the cost of storage / bandwidth)

Any good ideas/approaches?

Thanks

---

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [September 26, 2009, 1:38pm UTC](https://www.ruby-forum.com/t/cost-model-for-a-ror-where-users-could-upload-lots-of-file-what-approach/176175/2 "2009-09-26T13:38:28Z")

</div>

Greg H. wrote:

> Hi,
> 
> Any ideas/suggestions re what a good cost model / approach would be if  
> one’s Ruby on Rails application was to be successful, but noting users  
> (as part of the service/application) could upload lots of files  
> (images etc).
> 
> What’s a good way of have:  
> (a) a simple cost model for use of the site, e.g. free up to X but  
> costs Y after this per every Z,  
> (b) noting files/images etc have to be protected by the rails  
> authentication / authorization  
> (c) makes sure I won’t start losing money (e.g. if users have to pay  
> less than the cost of storage / bandwidth)
> 
> Any good ideas/approaches?
> 
> Thanks

Use an external repository for your images that has unlimited bandwidth  
unlimited drivespace and an acceptable uptime that charges a fixed cost  
per month.  
[www.unlimitedwebhosting.co.uk](http://www.unlimitedwebhosting.co.uk) is the what I use for image and doc  
hosting.  
This approach will massively improve performance of any Rails site that  
serves static data and is extremely simple to implement by making use of  
asset\_host.

Check out this blog

> **[Rails 2.0 New Features · devroom.io](https://www.devroom.io/2007/09/24/rails-20-new-features/)**
>
> Ariejan de Vroom's personal website on software engineering, electronics tinkering and car mechanics.

---

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [September 27, 2009, 8:41am UTC](https://www.ruby-forum.com/t/cost-model-for-a-ror-where-users-could-upload-lots-of-file-what-approach/176175/3 "2009-09-27T08:41:37Z")

</div>

so you still use one the well known rails hosts sites for your actual  
Rails app then James, but just use [www.unlimitedwebhosting.co.uk](http://www.unlimitedwebhosting.co.uk) for  
images etc right? then you just use the rails  
“config.action\_controller.asset\_host” concept (which was in the blog)  
to handle users browsers picking up images directly from  
[www.unlimitedwebhosting.co.uk](http://www.unlimitedwebhosting.co.uk)?

2009/9/26 James W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> > (a) a simple cost model for use of the site, e.g. free up to X but  
> > Use an external repository for your images that has unlimited bandwidth  
> > –  
> > Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> >

–  
Greg  
[http://blog.gregnet.org/](http://blog.gregnet.org/)

---

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [September 27, 2009, 9:00am UTC](https://www.ruby-forum.com/t/cost-model-for-a-ror-where-users-could-upload-lots-of-file-what-approach/176175/4 "2009-09-27T09:00:24Z")

</div>

Greg H. wrote:

> so you still use one the well known rails hosts sites for your actual  
> Rails app then James, but just use [www.unlimitedwebhosting.co.uk](http://www.unlimitedwebhosting.co.uk) for  
> images etc right? then you just use the rails  
> “config.action\_controller.asset\_host” concept (which was in the blog)  
> to handle users browsers picking up images directly from  
> [www.unlimitedwebhosting.co.uk](http://www.unlimitedwebhosting.co.uk)?
> 
> 2009/9/26 James W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
> 
> > > ï¿½ (a) a simple cost model for use of the site, e.g. free up to X but  
> > > Use an external repository for your images that has unlimited bandwidth  
> > > –  
> > > Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> > 
> > >
> 
> –  
> Greg  
> [http://blog.gregnet.org/](http://blog.gregnet.org/)

yup,  
I actually use [Railsplayground.com](http://Railsplayground.com) for hosting the Rails sites on.  
I’ve only moved about 20% of my images accross to the image hosting site  
and I have seen a noticeable performance improvement plus my bandwidth  
usage on the Rails host has dropped.  
My image hist gives me all the bandwidth and drive space I need  
(Unlimited) for a fixed cost Â£3.15 p/m with unlimited subdomains so I  
use subdomains for my customers sites and a domain for the main images  
that appear on all sites.

This has given me the possibility of hosting much greater numbers of  
sites on my Rails host.

I didn’t actually worry too much about the cost of my project kicking  
off because I knew that if it did then I’d be making money.  
I started with a basic developer package and just up[graded when I  
needed to with the full confidence that RailsPlayground would be happy  
and willing to cater for all my future requirements.

The secret is to find a host you can trust that will work with you and  
help you out.

---

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [September 27, 2009, 4:49pm UTC](https://www.ruby-forum.com/t/cost-model-for-a-ror-where-users-could-upload-lots-of-file-what-approach/176175/5 "2009-09-27T16:49:09Z")

</div>

Jruby has native multi-threading which could possibly give you better  
scalability for concurrent uploads as well, worth looking at.

On Sun, Sep 27, 2009 at 3:00 AM, James W.
