views:

98

answers:

3

When my user base grows, does Heroku take care of setting up multiple database servers for my Rails app or do I have to configure it manually somehow?

In other words, does Heroku scale well and correctly (replicate servers) when needed?

+2  A: 

I think that's the idea of Heroku - they handle all the administration and setup for you. You can add resources to your application to scale up instantly.

Veeti
+2  A: 

From the Heroku docs:

For Rails apps, database connectivity is configured automatically — your app should just work.

Their shared database plan, Koi, is $15 and offers 20GB of space. Performance shouldn't be much of a worry though it won't always be predictable since other users' actions can have an impact on it. As far as scaling goes, as your website grows and your database along with it, you can upgrade to a new plan or dedicated database server easily. Just make sure you scale your dynos as your traffic grows.

Gabriel Evans
+3  A: 

Heroku has everything managed in their cloud and has three ways to scale: db, dynos, and workers. Heroku will not scale your application for you. It is your responsibility to adjust settings that control how much cpu / database storage. I will outline how Heroku works below but right now directly answer the question by saying that there are two options for databases with Heroku: shared, dedicated. Dedicated machines keep info on one machine but machines are beefed up accordingly which Heroku dubs compute unit while shared dbs share machines for databases.

If you are reading this answer and don't know about Heroku it's more important to go check them out than reading on.

First let me say its FREE to deploy applications on Heroku unless you want to add resources. Deployment is done with your git such as:

  • heroku create
  • heroku push master
  • heroku rake db:migrate

Whenver you want to update your your app it's three things:

  • git add .
  • git commit
  • git push heroku

How is this possible. with the heroku gem.

It's kinda scary how much better Heroku takes care of deploying and scaling Ruby applications so I also had this question and did some research. It turns out that there are really only three things you need to know to scale your application with Heroku:

All you have to do is increase your dynos (basically thin processes) or workers (for delayed jobs) to scale your application.

There are basically three ways to sale your application

  1. Choose a DB
  2. Choose how many dynos you want running
  3. Choose how many workers you want running

Dynos and workers both run about $.05 / hour

Then you can choose from 5 Databse options.

  1. Blosom is free up to 5 Mb
  2. Koi is $15/month up to 20 Gb

And then there are dedicated servers for your DB which work like this:

  1. Ronin - $200 / month - 1 compute - 2 TB database max
  2. Fugu - $400 / month - 5 compute units - 2 TB database max
  3. Zilla - $1600 / month - 20 compute units - 2 TB database max

The only thing that is will be dedicated to one server is your database and you have to choose an option for that to happen. Everything else is in the cloud layered into different servers like this:

  1. HTTP Reverse proxy - takes care of DNS - works on Niginz
  2. HTTP Cache - Works on - Varnish
  3. Custom Routing Mesh - works on Erlang
  4. Dynos - Basically thin proceses
  5. PostgreSQL and Memcached
Sam
Great info, Sam! It is my understanding that you setup these Heroku settings and they stay that way unless you go back into the settings and tweak them. Heroku won't scale automatically for you, say if your app was backed up with background processes and could really use more workers, Heroku won't adjust that automatically for you.
raidfive
@raudfuvem - you are correct, it is your responsibility to adjust dynos and works. The only thing that Heroku will do and it's still not automatically is transfer your db to a dedicated server but that is after you make the change.
Sam
I've read about their databases, shared vs dedicated. Now, a dedicated database is NOT a dedicated database VPS server right? So what do they mean by I get 5 dedicated databases. Is one shared database a database where my tables are mixed with others? Or do they mean database server and not database. I don't get the picture. If it's inside a VPS, doesn't that mean i still share computer performance whether it's dedicated or shared? Could you get to the more technical stuff.
never_had_a_name
Can you show me where they say 5 dedicated databases. Do you mean compute units because those just mean a bigger processor on a single machine.
Sam
@sam..oh i read wrong, it was 5 compute units =)
never_had_a_name