Tuesday, July 1, 2008

How Much Would it Cost to run Twitter on Amazon's SimpleDB?

As you may or may not know, Twitter has had an amazing amount of downtime in the past few months and it may be due in part to running only three MySQL servers to run one of the most popular sites on the Internet. So lets say they wanted to use SimpleDB to get rid of their database issues, well lets try to figure out their costs based on some publicly available usage numbers and traffic numbers along with these BoxUsage numbers.

Twitter Usage

March 2008
Total Users: 1+ million
Total Active Users: 200,000 per week
Total Twitter Messages: 3 million/day

14 Million Visits per month with an average of 7 pages per visit = 98 million pageviews per month

Now lets assume that each page only does one (assume a small amount of caching) and each object has item has 5 attributes.

Translated to SimpleDB usage:

  • 3 million PUT's per day
  • 98 million QUERY's per month
  • 98 million GET's per month

3 million PUT's = (3 * $3.079) + (3 * 0.0000280 * 5^3) = $9.25 / day = $277.43 / month

98 million QUERY's = (98 * $1.96) + (98 * 0.00112 * 5) = $192.63 / month

98 million GET's = (98 * $1.305) + (98 * 0.00028 * 5^2) = $128.58 / month

For a grand total of $598.64 per month.

This only includes box usage for SimpleDB and does not include bandwidth (which is free if you're using EC2) or storage.

Wow, a lot cheaper than I would have expected. Also, you could reduce this cost significantly by doing some serious caching (if you develop in Java, check out SimpleJPA to get easy caching).

UPDATE: I miscalculated this when I first posted it by counting 98 million pageviews per day, when it should be per month. Should be all corrected now.