9

I have to move a business application into the cloud, therefore cost is one of my biggest concerns.

DynamoDB seems to be a good option, while a big part of our data is able to migrate from relational database to NoSQL. It's said, AWS DynamoDB is cost-efficient. What does that actually mean?

Our application executes a query which returns about 100k rows several times a day. Amount of rows written can be assumed the same. The database is hosted now on a fairly low hardware, which can be compared to t2.medium instance. On-demand (which is not the most cost-effective) database instance with PostgreSQL would cost ~ $55/month. Each time the query takes about 10 sec to execute.

Let's see to what the calculator says. DynamoDB bill depends on the throughput. 10 sec is not the point, let's say we can wait a whole minute. The query returns 100k rows. That means we need a peak throughput of 1667 reads/sec (assuming items are less than 1 kb), and the same write throughput. The calculator says: Estimate of your Monthly Bill ($ 859.39).

15 times more expensive than RDS (and still 6 times slower).

Am i calculating that in a wrong way? Is there something out of my scope? Or, probably, DynamoDB is not suited for this kind of task?

2 Answers2

5

I think DynamoDB isn't the right choice. As you said yourself:

DynamoDB bill depends on the throughput. 10 sec is not the point, let's say we can wait a whole minute.

DynamoDB is built for high throughput low latency. So the core feature of this Database is providing answers within single digit milliseconds. As you already figured out you pay per second which means if you don't need nearly the same amount (within the ability of scaling up and down) of reads/writes over a period of multiple hours DynamoDB is expensive as you pay for queries you don't need.

Our application executes a query which returns about 100k rows several times a day.

So AWS RDS seems to be more suitable for your case.

Osterjour
  • 825
  • 8
  • 12
  • A bit late, but thanks anyways :) I have already deployed the database to a PostgreSQL RDS instance and stay pretty much happy about it :) – Diligent Key Presser Aug 03 '16 at 14:32
  • Oh... sorry didn't recognize the age of your post. Was just clicking through the tags and answering questions without an answer ;) Maybe the answer helps somebody else. – Osterjour Aug 04 '16 at 12:25
1

Your use case could be implemented using DynamoDB for free.

You get 25gb of storage, 25RCU and 25WCU for nothing all year round as part of the AWS Free Tier. All you need to do is engineer your app to keep data throughput within these limits and your bill will amount to $0.00.

Just throttle your throughput, work in batches. You get 25 1Kb writes per second for free so teach your app to write 25 items per second - zero cost.

Lloyd
  • 119
  • 4