2

Possible Duplicate:
Is it possible to use an EC2 RDS MySQL instance as a slave to an external master?

My read-intensive application needs to scale horizontally. It will be deployed by various clients using Amazon EC2. My initial thought is that a basic setup will utilize one RDS instance and one EC2 instance. The EC2 (c1.medium) instance will run a webserver and a local MySQL read replica of the RDS server. The application is configured to use the RDS server for writes and localhost for reads. Using an autoscaling group, more c1.medium EC2 instances are booted according to load. Every new EC2 instance will have its own local mysql replicated data for reading.

Now the question: can I hook into RDS to create local read replicas?

The obvious alternative is to boot extra official read replica nodes using the RDS API, but I don't like that because then I would need to scale in steps of 2 machines instead of 1, which is more costly. Also, I prefer to have mysql read queries local because of the latency.

6
  • 1
    This is not a duplicate. I am asking about RDS to EC2 replication, not the other way around (which requires whole other privileges).
    – Willem
    Feb 6, 2012 at 9:51
  • Why would you need to scale in steps of two machines instead of one? There's a good chance your DB will need to scale independently of your web tier.
    – ceejayoz
    Feb 8, 2012 at 16:41
  • 1
    @Willem: Good point to be precise here - I've interpreted the quoted AWS response both ways already though, which unfortunately applies indeed (see my updated answer for details). Feb 8, 2012 at 16:41
  • @ceejayoz: possibly, but even then there will be less granularity in scaling. Say at a given time both the database and the application pass a load threshold and two new instance are required. Then I will have two instances that are <5% utilized, instead of one. Now you would say, the costs are neglectible for one setup, but I plan to boot hundreds of these auto scaling groups.
    – Willem
    Feb 9, 2012 at 10:04
  • If you've got hundreds of servers, two more hardly seems like it's a big deal.
    – ceejayoz
    Feb 9, 2012 at 14:37

2 Answers 2

2

Update/Clarification

While I'd interpret the linked and quoted AWS forum response regarding Non-RDS to RDS replication both ways already (else they'd probably mentioned the alternative), a related question explicitly asking about Using RDS as replication master has likewise not been resolved as of today.


Unfortunately this is still not supported by Amazon RDS, see drcursor's answer to the similar question Is it possible to use an EC2 RDS MySQL instance as a slave to an external master?:

This is still not supported as of February 2011, RDS instance as a replication slave:

Non-RDS to RDS replication is not currently supported [...]. However, we will log your interest for our future road map planning.

0

Why would you not simply use the RDS read replicas to setup smaller instances to do your reads from and leave the master RDS for the writes? It would appear that your system is already developed to handle that. There is not easy way to setup replication of the RDS instances without doing repeated mysqldumps and then re-importing locally. If your app is doing proper data caching internally it should not have to scale 1:1 for read replicas. If data caching in the application is so bad that you have to have a 1:1 ratio than I'd go back and retool the application or look into using memcache (ElastiCache) for intermediate storage of cached data from RDS reads.

Not the answer you're looking for? Browse other questions tagged .