The hidden cost multiplier of fixed-price cloud resources

Cost is a big part of designing apps for the cloud. Some services have only variable costs, such as DynamoDB, Lambda, S3. And some come with fixed costs as well.

For example, Kinesis Data Streams is priced:

Per stream, per hour $0.04 Data ingested, per GB (Includes 24-hour retention) $0.08 ... Data stored, per GB-month (beyond 24 hours, up to 7 days) $0.10

$0.04 per hour translates to ~$30 per month, even if the stream is idle the whole time. That's a small portion of a usual cloud bill, so using Kinesis is justified.

But there is a hidden cost multiplier: a multi-account setup.

One of the huge advantages of cloud environments is that it's very easy to replicate the production environment. Every developer can have a deployment that closely matches the real product, making it easy to experiment. I'm a huge fan of a multi-environment setup as I wrote an article about it.

But let's say there are 5 developers, and a develop, staging, and a production account, all running the same app. One Kinesis Data Stream just turned into 8, and its $30 a month cost swelled to $240 per month. And of course, if you have more fix-priced resources (RDS databases, Route53 Hosted Zones) this multiplication can get rather big.

A truly serverless application scales down to zero and also comes with negligible fixed costs, so it can be run in many copies without extra costs. There are justifiable cases where using other resources, but I believe the default choices should have only variable costs.

August 15, 2024

Free PDF guide

Sign up to our newsletter and download the "Foreign key constraints in DynamoDB" guide.