How Duolingo Slashed Cloud Spending by 20%
Learn how Duolingo took a systematic approach to reduce cloud costs and improve infrastructure efficiency.
Rapid feature development often comes with a hefty cloud bill. While companies like Zomato achieved 30% cost reduction through AWS Graviton2 adoption, others like Duolingo have taken different approaches to cloud cost optimization.
Duolingo expanded its offerings with immersive features like DuoRadio and Adventures, but each new feature demanded significant cloud resources.
While these features were necessary for user experience, they pushed cloud spending into the millions of dollars annually.
To address this, their team launched an initiative to optimize cloud spending without compromising product quality or user experience. Their systematic approach reduced cloud costs by 20% in just a few months.
Core infrastructure challenges at scale
Duolingo's rapid feature expansion created complex infrastructure challenges. New features like Stories and Adventures required additional computing resources, while legacy systems continued consuming valuable capacity.
The infrastructure grew to include multiple database clusters, extensive S3 storage, and numerous microservices—many of which ran inefficiently with default configurations.
This combination of growing requirements and legacy systems pushed cloud costs into millions annually.
How did they resolve it?
The first step in Duolingo's cost optimization journey was understanding exactly where the cloud budget was going.
The team implemented CloudZero to break down AWS costs into queryable items, making it easy to spot unusual spending patterns and identify optimization opportunities.
This visibility quickly paid off. The team discovered surprising cost drains - like a staging environment costing more than production because of an overlooked test configuration.
Every engineering team could now see and manage their service costs by integrating cloud cost data into regular metrics and sending weekly reports.
The systematic review revealed several opportunities for immediate cost reduction:
Cleaned up legacy resources
The team found multiple inactive systems still consuming resources - old ElastiCache clusters, unused databases, and even entire microservices from deprecated features.
For active S3 buckets, they implemented lifecycle rules to manage data retention, automatically cutting storage costs.
As Duolingo's CTO explained, "Many of our cost savings initiatives involved cleaning up tech debt and simplifying complex code. Not only did we save a lot of money, we also improved the health of our codebase."
Optimized service performance
Through careful testing, the engineering team found that most services could run efficiently at 90-95% memory utilization, which is much higher than the original conservative settings.
One service alone was so overprovisioned that right-sizing it saved hundreds of thousands of dollars annually.
Improved infrastructure efficiency
After analyzing usage patterns, Duolingo migrated key databases to Aurora I/O-optimized instances, which led to major cost savings without compromising performance.
The team also refined how they purchase and use Reserved Instances across EC2, RDS, and ElastiCache services, getting better value from long-term commitments.
You could also use techniques like resource right-sizing, turning off idle resources, and adopting cost-effective pricing models for cloud cost reduction.
(Source)
Business impact & results
The optimization initiative delivered significant results in just a few months. Cloud spending decreased by 20% through three key improvements:
Infrastructure efficiency
Migrating to Aurora I/O optimized databases and implementing strategic Reserved Instance purchases reduced computing costs.
(They saved several hundred thousand dollars a year by switching a single database to Aurora I/O optimized)
The team removed redundant systems, including unused ElastiCache clusters and deprecated microservices.
Performance optimization
By fine-tuning service configurations to run at 90-95% memory utilization and optimizing cache settings, service-to-service traffic dropped by 60%. A complete code refactor removed 2.1 billion unnecessary daily API calls.
Resource management
Implementing automated lifecycle rules for data storage and right-sizing service allocations generated substantial savings—a single service optimization saved hundreds of thousands annually.
Questions to ask yourself about optimizing cloud costs
As we've seen, Duolingo's systematic approach to cloud cost optimization delivered impressive 20% savings.
But how can you replicate this success within your organization?
It starts by asking the right questions. Here are some important ones to consider:
How can we systematically assess and manage cloud costs across the organization?
Visibility is key. Use cost management tools to create a structured framework for clear visibility into cloud spending and precise budget allocation. Ensure regular reporting and enforce accountability measures to monitor and control cloud usage across all teams.
What cloud cost optimization strategies should we adopt for provisioning cloud resources and controlling spending over time?
Implement dynamic provisioning and automated scaling to match resource usage with demand effectively. Conduct continuous cost analysis and set budget alerts to maintain strict control over spending.
How can we prevent over-provisioning and unnecessary costs?
Regularly audit your cloud resources and right-size infrastructure based on demand forecasting and capacity planning. Most importantly, foster a culture of cost awareness among your developers and IT teams.
What metrics should we monitor beyond the cloud service bill?
Look beyond just the monthly cloud bill. Tracking metrics like per-service costs, resource utilization, and performance against capacity can offer deeper insights. This also includes availability metrics to ensure cost-saving measures don't compromise service quality.
Here are some of the insightful editions you may have missed:


