Hacker News new | past | comments | ask | show | jobs | submit login
Aurora I/O optimized config saved 90% DB cost (graphite.dev)
136 points by fosterfriends on Aug 10, 2023 | hide | past | favorite | 60 comments



> We reached out to some contacts at AWS to find out why the Aurora team built this. Did I/O Optimized do some clever engineering with sharding and storing data in S3? Were they just feeling generous?

No surprises here. Come what may, Amazon has always strived to lower costs (the low costs, more customers, more volume fly-wheel?). This is but one example.

AWS adopted cost-follow pricing for S3 (very different from value-based pricing) after apparently a lengthy debate: As they get more efficient, they want to pass down those savings to customers (as price reductions):

  S3 would be a tiered monthly subscription service based on average storage use, with a free tier. Customers would choose a monthly subscription rate based on how much data they typically needed to store. Simple ... The engineering team was ready to move on to the next question.

  Except that day we never got to the next question. We kept discussing this question. We really did not know how developers would use S3 when it launched. Would they store mostly large objects with low retrieval rates? Small objects with high retrieval rates? How often would updates happen versus reads? ... All those factors were unknown yet could meaningfully impact our costs ... was there a way to structure our pricing [to] ensure that it would be affordable to our customers and to Amazon?

  ... the discussion moved away from a tiered subscription pricing strategy and toward a cost-following strategy. "Cost following" means that your pricing model is driven primarily by your costs, which are then passed on to your customer. This is what construction companies use, because building your customer's gazebo out of redwood will cost you a lot more than building it out of pine.

  If we were to use a cost-following strategy, we'd be sacrificing the simplicity of subscription pricing, but both our customers and Amazon would benefit. With cost following, whatever the developer did with S3, they would use it in a way that would meet their requirements, and they would strive to minimise their cost and, therefore, our cost too. There would be no gaming of the system, and we wouldn't have to estimate how the mythical average customer would use S3 to set our prices.
From: https://archive.is/lT5zT

I wonder what explains AWS' high egress costs, though.


> I wonder what explains AWS' high egress costs, though.

Vendor lock-in. It prevents people from otherwise picking the best provider for the task at hand - for example using some managed AWS services, but keeping the bulk of your compute on-prem or at a (much cheaper) bare-metal host.

It makes sense, but I wish there was an option to opt-out, as to allow high-bandwidth applications that are fully on AWS (at the moment AWS is a non-starter for many of those even if you have no intention of using AWS competitors like in the scenario above).

Maybe they should just price end-user egress vs competitor egress differently (datacenter and business provider IPs are priced like now, but consumer-grade provider IPs are much cheaper/free)? That would discourage provider-hopping, while making AWS a viable provider even for high-bandwidth applications such as serving or proxying media.


Unpopular opinion: There are a lot of free networking products, and it probably makes sense to hide all that in the margins of a few products (egress, NAT gateways) rather than penny pinch every API.


Even one cent per gigabyte would pay for so much of that stuff.

If subsidizing the networking products would require a 10x or higher markup on egress, then that is not the correct way to organize prices.


I've migrated stuff away from AWS. It's not hard, and AWS doesn't make it hard to do.

Egress costs are where AWS makes money. You can get around that by negotiating lower cloudfront costs then basically exfiltrating your data via cloudfront. We were getting < .01/gb pricing (.0071?) for only like a $2k/mo commitment.


Explanation makes sense, except cross availability zone traffic is also expensive and by this logic it should not be.


It’s presumably expensive because there’s a lot less inter-AZ bandwidth than there is intra-AZ bandwidth for the obvious reasons.


But if that's the case, this could be the reason of egress cost. I mean egress cannot be cheaper for aws than cross az. So if we assume that this is just expensive then we should assume the same for egress


IIRC some cross az traffic uses vendors' fiber (albeit definitely encrypted) but I could be completely wrong.


DirectConnect pricing might be cheaper, if a company is really trying to get stuff out, but I haven't run the numbers to determine if the connection charge plus DTO (data transfer out) would save money over regular S3 egress charges. see https://aws.amazon.com/directconnect/pricing/


> No surprises here. Come what may, Amazon has always strived to lower costs

Maybe it's just a goal to reduce costs, but it seems likely that this is a response to Google's introduction of AlloyDB, a Postgres-compatible database competing with Aurora that is advertised as having "no...opaque I/O charges". I doubt Amazon was feeling generous.


> Come what may, Amazon has always strived to lower costs

Agreed.

Azure on the other hand is notoriously expensive and do everything possible to raise prices.


More than anything else, I'm bothered by Cloudwatch's pricing. $3/dashboard/month when it's essentially just a JSON config? $0.30/metric/month, with the risk of a junior engineer easily being able to add one line of code that 1000X or more multiplies your AWS bill?

And then tie in how some AWS services only a binary choice between logging ridiculous volumes of data or nothing at all (looking at you, AppSync) to make the log ingestion fees high too.


> No surprises here. Come what may, Amazon has always strived to lower costs

I have a hard time reading "amazon" and "lower costs" in the same sentence.

The cloud is consistently an order of magnitude more expensive than self hosting, even when including people cost, unless you need every single bit of load balancing/high availability/normalization they provide.

The vast majority of projects don't.


I work for a large insurance company. We had moved from on-prem to Aurora, but our design strategy did not get updated in the process, and our IO costs were about 80% of our total AWS bill. We just switched to this new IO optimised pricing and we’re seeing huge discounts. I can sleep a bit easier now :) (we still are going to change our DB design to reduce IO anyway)


We have a 10TB database we switched from Aurora to Postgres and it cut out bill by 80%. However, there are some differences in our schema such as now using native partitions so it's hard to tell how much $ is due to the switch and how much due to our table and query design.

We have a similar story with DynamoDB too.


Curious what you mean by switching from Aurora to Postgres? AWS offers Postgres on Aurora, and Postgres on regular RDS. Do you mean you switched to RDS, or off of AWS altogether, or something else?


I mean that we switched from RDS Aurora Postgres to RDS regular Postgres


Probably means Aurora MySQL. In CloudFormation and other AWS artifacts, "Aurora" is a keyword that regularly comes up meaning MySQL, since that was the original target for Aurora years before the Postgres flavor was released. There are AWS old-timers at my shop that call it Aurora, and it shows up in their YAML.


To whomever downvoted, when specifying the AWS::RDS::DBCluster "Engine" property in CloudFormation, aurora = mysql5.6 and below, aurora-mysql = mysql5.7 or mysql8.x, aurora-postgresql = postgres. Since 5.6 was deprecated, the "aurora" engine type was removed the CF docs, but it was there until a few years ago. "Aurora" was synonymous with MySQL for a while.

#AWSHistory


People downvoted because you were assuming that when someone says "we moved to postgres" they would mean "we moved to mysql" as if they wouldn't know what they were talking about.

Even your history thing makes no sense, Aurora Postgres was launched 9 months after Mysql version in July 2015.


Aurora MySQL was released October 2014.

https://aws.amazon.com/blogs/aws/highly-scalable-mysql-compa...

Aurora Postgres hit general availability October 2017. (Sorry, betas and early release offerings don't count.)

https://aws.amazon.com/blogs/aws/now-available-amazon-aurora...

Quick math… carry the two… compute the partial differential equation…

Looks like 3 YEARS between the release of Aurora MySQL and Aurora Postgres.


Yes, if you choose other definitions for launch dates you can come up with many different timespans.


You're right. I should use the GA announcement for Aurora MySQL as well.

…which was November 2015.

https://aws.amazon.com/blogs/aws/now-available-amazon-aurora...


So now tell me, between 7-9 years have gone by since Aurora is a multi database product, what sense does it make to assume its mysql? That's like saying at your company people call AWS "S3" or "SQS" because that's how it started. I don't even know what point you're trying to make because unless the majority of the time was mysql only and then recently other databases would've been added, the anecdote would still not make sense.


https://news.ycombinator.com/item?id=37085062

The majority of the time, it was identified as "aurora" in CloudFormation templates. 5.6 hit EOL in February of THIS YEAR, aka 2023.

https://aws.amazon.com/blogs/database/upgrade-amazon-aurora-...

So… that would make it the majority of time, wouldn't it? Why does this upset you so?


Someone disagreeing with you doesn't mean they are upset my friend. Have a good one because we're not going to agree.


> People downvoted because you were assuming that when someone says "we moved to postgres" they would mean "we moved to mysql" as if they wouldn't know what they were talking about.

What? That's not what that comment says at all. They're saying that aurora mysql was a plausible interpretation of what OP moved from, before OP clarified.


Yep, I was wrong about the source DB in retrospect, but that other guy just seems to want to argue with straw men. Takes all kinds, I guess.


> using native partitions

FWIW, I'm actively exploring native partitions on Aurora with Postgres and I'm seeing very little benefit. Two identical tables, each with 500M+ rows, and I'm not seeing any meaningful performance/IO changes. A composite index with the partition key as the first entry has been as effective for reducing IO and query time as partition pruning. I'm sure there are workloads where partitioning makes more sense, but I've been surprised by how little difference there was in this case.


> it's hard to tell how much $ is due to the switch and how much due to our table and query design.

Sounds like good material for a technical blog post.


What's the story with DynamoDB?



wild part is that there's been zero observable difference in performance for this config change, I think it's just a difference in billing calculation.


> I think it's just a difference in billing calculation

Agree. It feels like an actuary ran some numbers and found that high I/O customers spend more on other AWS services and are more profitable than low I/0 tenants, so they changed the formula to reduce churning those high I/0 tenants.


This feels likely!


Our commit latency dropped when we turned it on, so _something_ changed on a technical level


I highly recommend communicating with your business support team at AWS.

Mine have always been helpful and have kept us up to date on releases like this, sometimes we even get them before they are GA.


Maybe good to review the technical details around the feature. You might want to have a look at the blog in the last reference, and the sanity check Lambda script, before switching. Or also this specific timestamp in the presentation linked below: https://youtu.be/FBZmxLm0Bhw?t=355

"AWS announces Amazon Aurora I/O-Optimized" - https://aws.amazon.com/about-aws/whats-new/2023/05/amazon-au...

"New – Amazon Aurora I/O-Optimized Cluster Configuration with Up to 40% Cost Savings for I/O-Intensive Applications" - https://aws.amazon.com/blogs/aws/new-amazon-aurora-i-o-optim...

"Getting Started with Amazon Aurora I/O-Optimized" - https://youtu.be/OlFeaVd6Ll4

"AWS On Air ft. Introducing Amazon Aurora I/O Optimized" - https://youtu.be/FBZmxLm0Bhw

"AWS Aurora IO Optimized Storage — Is it worth it?" - https://towardsaws.com/aws-aurora-io-optimized-storage-is-it...


I didn't know about Aurora IO Optimized until just now. That solves my biggest fear of Aurora which is an optimized query wreaking havoc on our IO and racking up a bill. Very cool offering to see.


Greg earned a new espresso machine for his efforts here!


Slowly rebuilding Airbnb's Okay Coffee club...


nice


Where can you see how much of your Aurora spend is on I/O? There must be a Cloudwatch metric somewhere


Im a big fan of Datadog's Cloud Cost management: https://www.datadoghq.com/product/cloud-cost-management/

Outside of that though, you can go to your AWS billing, filter on RDS, and slice by usage type. They make you dig, which is why I pref Datadog


If you hook up https://vantage.sh you can filter by RDS costs > Cost by Category on a Cost Report to see this.

Disclaimer: I work for Vantage.

PS. I maintain https://ec2instances.info/rds and recently added support for Aurora I/O Optimized pricing.


You can see it in cost explorer if you break down by one of the spend types. Went and checked it: group by usage type and then filter for service: RDS and you can see your io usage broken out in plain baa cost explorer.


Lovely, thank you!


Wow, good on AWS for releasing such a useful feature. It does feel a little uncomfortable to have to wait on an interested party to make optimizations to benefit you (to the tune of 90% cost savings!!), but I guess that's the name of the game in public cloud.


I wished I knew about this!! Migrating my Aurora clusters rn


I am an existing aurora customer and for me also aurora is already contributing to 33% of the cost, while the team is working on optimising pgsql queries, this is a great hope. I hope xmas come early for us as well :)


Does anyone have any experiences to share about the performance differences between regular RDS/MySQL and Aurora for MySQL (I/O optimized config)?

(The article is about the PostgreSQL variant.)


It's so amazing when CTO cares about technology and not only shareholders return and gains.


You're thinking of the CEO.


there is a chance they got pushed by large customers migrating to on prem because of high cost


Customer buys cloud service with unpredictable pricing. Gets bitten by high prices. Switches to (new!) cloud service with predictable pricing. Prices are lower.

Also, it sounds like they could save money by not using cloud.


> Also, it sounds like they could save money by not using cloud.

This always comes down to opportunity cost and staffing. If their team doesn’t include Postgres or MySQL experts, or security experts, etc. outsourcing that to AWS allows them to spend their staff budget on things they cannot outsource.

One thing to remember is that your organization can only do so many things a year. That number varies based on complexity, internal overhead, customer and regulatory overhead, etc. but it’s finite and lower than you think. If you’re spending time on MySQL patching or trying to figure out how to patch your servers, that’s taking decisions away from your product. That can still be the right call but one thing I’ve noticed over the years is that many people are prone to dramatically underestimating that cost.


Everyone who is using cloud could save money by not using cloud. However sometimes the money is worth it for the features and guarantees you get.


But especially everyone who is using cloud with unpredictable pricing models. Unpredictable means it's designed to screw you and make sure you don't have any grounds to complain.


For us, it would be net more expensive because we need to factor in the labor cost of an engineer maintaining a non-cloud DB.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: