AWS DynamoDB Cost efficiency

amazon-dynamodbamazon-rdsamazon-web-services

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?

Best Answer

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.

Related Topic