Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku takes care of multiple database servers?

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?

like image 949
never_had_a_name Avatar asked Aug 20 '10 20:08

never_had_a_name


2 Answers

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:

  • Dynos
  • Workers
  • Databases

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
like image 78
11 revs Avatar answered Oct 09 '22 03:10

11 revs


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.

like image 43
Veeti Avatar answered Oct 09 '22 01:10

Veeti