Cloud Database Cost Optimization with FOSS
How an open-source database migration cut cloud costs by 60-70%.
Oct 13, 2024
case Page image

Summary

A client faced an unexpected $20,000 monthly spike in database IOPS (Input/Output Operations Per Second) costs after deploying their data warehouse platform, forcing them to scale back data refresh cycles and limiting their ability to generate timely insights. The steep rise in costs was driven by the increasing demands of frequent data processing, a workload pattern that managed database pricing wasn't built to absorb cheaply.

Bajaj Tech.AI proposed and implemented a transition from managed cloud database services to PostgreSQL, a free and open-source (FOSS) database deployed on EC2 instances. The result was a 60-70% reduction in monthly cloud expenses, with IOPS costs eliminated entirely, while maintaining high availability and performance.

Business Challenge

The client experienced a sudden $20,000 monthly increase in database IOPS costs after implementing their data warehouse platform. Their hourly data processing requirements consumed a significant amount of IOPS, leading to inflated expenses on a managed database service that priced IOPS as a premium, pay-as-you-go resource.

To manage these costs, the client had to reduce their data refresh cycle to once per day directly limiting their ability to perform timely data analysis and generate insights when they were needed most. Beyond IOPS, other expenses compounded the problem:

  • Storage costs tied to the managed service's pricing structure
  • Compute instance costs that didn't flex to match actual workload demand
  • Data transfer costs within and across the client's AWS environment
  • Frequent backup costs adding further to the monthly bill

This situation called for an immediate cost-optimization strategy, one that wouldn't force the client to keep sacrificing data freshness just to keep costs under control.

Solution Approach

To reduce costs while maintaining high availability and performance, Bajaj Tech.AI proposed a shift to PostgreSQL deployed on EC2 instances, a more flexible, open-source alternative to managed services like Aurora PostgreSQL that enabled direct cost control and optimization. Rather than treating the database as a black box managed entirely by the cloud provider, this approach gave the client's team direct ownership over how compute, storage, and IOPS were provisioned and priced.

  • Cost savings through right-sizing: Deploying PostgreSQL on EC2 allowed significant reductions in IOPS, storage, and compute costs compared to managed services. The ability to right-size EC2 instances to match actual workload demands offered far greater flexibility in resource allocation and pricing.
  • Configuration flexibility: PostgreSQL on EC2 allowed for more customizable configurations optimized database settings, indexing strategies, and extensions tailored to the client's specific data processing needs enhancing the performance of their data warehouse workloads beyond what the managed service permitted.
  • High availability by design: A High Availability (HA) setup was implemented using industry-standard tools, ensuring automatic failover and load balancing. This minimized downtime and ensured consistent data access and reliability, critical for maintaining operational efficiency.

The core trade-off was accepting more direct ownership of database management in exchange for dramatically lower costs and far greater configuration control, a trade that paid off decisively for this client's workload.

Business Impact & Results

The implementation of PostgreSQL on EC2 led to substantial, quantifiable cost savings and gave the client far greater control over resource allocation, delivering long-term financial benefits for their data warehouse platform without the compromises the client had feared when initially considering a move away from a managed service.

  • 60-70% reduction in monthly cloud expenses: The transition to EC2 delivered a substantial overall cut in monthly cloud costs, with IOPS costs eliminated entirely.
  • Lower storage costs: Storage costs were significantly lower compared to the pricing structure of managed services like Aurora.
  • Reduced data transfer expenses: PostgreSQL on EC2 allowed for more efficient data movement within the AWS ecosystem, further reducing data transfer costs.
  • No managed service fees: Since PostgreSQL is open-source, the client avoided the additional fees associated with managed services, contributing to a significant reduction in overall operational expenditure.

Following the success of this implementation, the client expanded their open-source strategy, migrating most of their database engines, including NoSQL databases to open-source alternatives.

The savings weren't a one-time event, they gave the client the confidence to extend the same open-source strategy across their broader database estate.

Key Takeaways

  • A single unexpected cost spike, in this case, IOPS, is often a signal that a managed service's pricing model no longer fits the actual workload
  • Migrating to open-source databases on right-sized compute can cut cloud costs by 60-70% without sacrificing performance or availability
  • High Availability doesn't require a managed service, it can be engineered directly with the right tooling and architecture
  • Cost savings from a successful open-source migration often justify extending the same strategy across other parts of the database estate
  • This kind of infrastructure discipline is what keeps real-time platforms like an OBT Data Warehouse financially sustainable at scale

Conclusion

For this client, moving from a managed database service to open-source PostgreSQL on EC2 turned a runaway $20,000-a-month cost spike into a 60-70% reduction in overall cloud spend without compromising on performance or availability. Organizations facing similar cost pressure from managed cloud services can take a clear lesson from this engagement: the convenience of a managed service often comes at a cost premium that isn't always justified once a workload reaches meaningful scale, and open-source alternatives deployed thoughtfully can deliver the same reliability at a fraction of the price. The fact that this client went on to migrate other database engines to open-source alternatives is itself a signal of how confident the results made them.

This kind of cost discipline pairs naturally with the data engineering work behind platforms like the OBT Data Warehouse built for a leading NBFC since a real-time data platform only stays viable long-term if its infrastructure costs scale sensibly with usage.

Looking to solve a similar business challenge? Connect with our experts to explore the right solution for your organization.

Written by
Biswajit Mukhopadhyay
Head - Data Engineering & Analytics
Cloud Database Cost Optimization with FOSS | Bajaj Tech.AI