Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to scale horizontally Amazon RDS instance?

How to scale horizontally amazon RDS instance? EC2 and load balancer+autoscaling is extremly easy to implement, but if I want scaling amazon RDS? I can ugrade my RDS instance with more powerfull instance or I can create a read replica and I can direct SELECT queries to it. But in this mode I don't scale anything if I have a read-oriented web application. So, can I create RDS read replica with autoscaling and balance them with load balancer?

like image 569
Alessandro Corradini Avatar asked Feb 07 '15 17:02

Alessandro Corradini


People also ask

Can you scale RDS horizontally?

With Amazon Relational Database Service (Amazon RDS) for PostgreSQL, you can scale a database instance vertically or horizontally.

Does AWS support horizontal scaling?

Horizontal scaling in AWS. A simple example of horizontal scaling in AWS Cloud is adding/removing Amazon EC2 instances from your application architecture behind Elastic Load Balancer.

Can we scale RDS server?

Scaling in RDSYou can scale both horizontally and vertically in RDS, with Read Replicas being an example of horizontal scaling. Let's talk about how to enable Read Replicas, and how to promote a Read Replica to a master standby instance. Select the instance, and click 'Create read replica' under actions.


2 Answers

You can use a HAProxy to load-balance Amazon RDS Read Replica's. Check this http://harish11g.blogspot.ro/2013/08/Load-balancing-Amazon-RDS-MySQL-read-replica-slaves-using-HAProxy.html. Hope this helps.

like image 137
Magda Avatar answered Sep 23 '22 10:09

Magda


Note RDS covers several database engines- mysql, postgresql, Oracle, MSSQL.

Generally speaking, you can scale up (larger instance), use readonly databases, or shard. If you are using mysql, look at AWS Aurora. Think about using the database optimally- perhaps combining with memcached or Redis (both available under AWS Elasticache). Think about using a search engine (lucene, elasticsearch, cloudsearch).

Some general resources:

  • http://highscalability.com/
  • https://gigaom.com/2011/12/06/facebook-shares-some-secrets-on-making-mysql-scale/
like image 38
tedder42 Avatar answered Sep 22 '22 10:09

tedder42