Tuesday, October 22, 2013

AWS Cost Saving Tip 17: Add Amazon RDS Read Replica's on need basis and save costs

Many online applications are usually Read intensive in nature. Though the usage of Cache, NoSQL, CDN are becoming part of the core architecture in many such applications, still most of them are heavily dependent upon Traditional RDBMS (like MySQL, Oracle) for serving their requests.
Architects usually design their DB tier with Master + Read Slaves model to cater the read intensive needs of the application. Writes and Immediate Write + Reads are directed to Master and all other Read queries are balanced between Read Slaves. Translating this model to AWS infrastructure means, using RDS MySQL Master + Multiple Read Replica Slaves.

To know more about Load balancing Amazon RDS Read Replica's Click here




Scenario: Weekly load volatility impacts: 
Online Ticketing and Travel companies are usually prone to weekly fluctuations in their load pattern. Imagine during peak load they need five M2.4XLarge RDS MySQL Read Replica's to serve their read intensive site.

As an Infra Architect you have two options in the Elastic AWS world: 
Option 1: Run your DB tier with peak capacity all days of the week. ( May be suitable for Traditional infra environments, but a bad idea in AWS infra)
Option 2: Elastically increase the number of RDS Read Replica instances during the peak period and decrease the number of instances once the peak period is over. (AWS is built for leveraging such cases)

Number of EC2 Instances
Number of days in a week
EC2 Instance Type
Weekly($)
Monthly($)
5
7
M2.4XLarge
1860
7442



1860
7442
2
4
M2.4XLarge
425
1701
5
3
M2.4XLarge
797
3189



1222
4890

Cost for Option 1: Running all 5 of them for a Week costs : $1860
Cost for Option 2: Running with 2 RR normally for 4 days a week and elastically increasing to Five M2.4Xlarge during the peak days(i.e. three days a week) will cost : $1222

Savings: From the above analysis you can observe that elastically increasing/Decreasing Amazon RDS RR based on your load you can achieve ~30 % cost savings in a week for the mentioned use case.

To know more about "How Amazon Auto Scaling can save costs on your Web/App Tier ? Click here "

Scenario: Impact during Campaigns 
Imagine your online business demands big campaigns once every quarter. The campaign usually runs for 2 weeks and traffic increases 4-5X during these times. During normal period you run 1 RDS Read replica and during campaigns you need 5 RDS Read replicas. 

If the campaign is planned once a year during holiday season, companies lease hardware, but if the campaign is every quarter or more frequent it becomes irrelevant to lease-build-maintain peak capacity.


Number of EC2 Instances
Number of Months
EC2 Instance Type

Monthly($)
5
10
M2.4XLarge
All times
98877




98877
1
10
M2.4XLarge
Other times
16479
5
2*
M2.4XLarge
During campaigns
16479




32959
Instance Hours per day: 744
*Campaign weeks are aggregated to months
US-Oregon region - $2.215 (M2.4Xlarge RDS RR pricing as on posting)

Cost for Option 1: Running all 5 of them for a year costs :  98877 USD
Cost for Option 2: Running with 1 RR on regular weeks and elastically increasing to Five M2.4Xlarge during the peak weeks will cost : 32959 USD a year

Savings: From the above analysis you can observe that elastically increasing/Decreasing Amazon RDS RR you can achieve ~55 % cost savings in a year.

For in depth analysis on Amazon RDS Second tier Read Replica's Click here 

No comments:

Need Consulting help ?

Name

Email *

Message *

DISCLAIMER
All posts, comments, views expressed in this blog are my own and does not represent the positions or views of my past, present or future employers. The intention of this blog is to share my experience and views. Content is subject to change without any notice. While I would do my best to quote the original author or copyright owners wherever I reference them, if you find any of the content / images violating copyright, please let me know and I will act upon it immediately. Lastly, I encourage you to share the content of this blog in general with other online communities for non-commercial and educational purposes.

Followers