有没有人想出如何扩展亚马逊RDS读副本? [英] Has anyone figured out how to scale Amazon RDS read replicas?
问题描述
我最近成立了一个读副本采取一些读负载了我的亚马逊多AZ RDS实例。亚马逊的文件明确指出,这是到你的应用程序来确定如何读取流量分布在你读的副本。
I've recently set up a read replica to take some of the read load off of my Amazon multi-AZ RDS instance. The Amazon documentation clearly states that it is "up to your application to determine how read traffic is distributed across your read replicas".
有没有人想出了一个可管理的方式来扩展读取副本?这似乎是一个很好的可扩展的解决方案并不具备我的应用程序的硬codeD不同地区的特定副本阅读。有没有一种方法来设置它就是类似于把EC2实例在负载均衡?
Has anyone figured out a manageable way to scale read replicas? It doesn't seem like a very extensible solution to have different parts of my application hard-coded to read from specific replicas. Is there a way to set this up that is analogous to putting EC2 instances behind a load balancer?
推荐答案
这是AWS工程师提供了一些深入的问题<一href="http://www.quora.com/What-is-the-best-way-to-distribute-read-traffic-among-Amazon-RDS-read-replicas">here.
An AWS engineer provided some insight into the question here.
下面是他的回答的一个片段:
Here is a snippet of his response:
一般你可以负载平衡流量在以下三个逻辑的地方:
in general you can load-balance traffic at the following 3 logical places:
- 在应用层 - 创建多个连接池,并把所有读取到读副本
- 在Web框架/中间件 - 多个数据库的一些Web框架已经内置支持[1]
- 在外部的代理 - 您可以使用像MySQLproxy [2] 外部代理。
- Application layer - create multiple connection pools and send all reads to the read-replicas.
- Web framework/middleware - some web frameworks have in-built support for multiple databases [1].
- External proxy - You can use an external proxy like MySQLproxy [2].
[1] - <一href="https://docs.djangoproject.com/en/dev/topics/db/multi-db/">https://docs.djangoproject.com/en/dev/topics/db/multi-db/
[2] - https://launchpad.net/mysql-proxy
这篇关于有没有人想出如何扩展亚马逊RDS读副本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!