How to scale horizontally an instance of Amazon RDS?

How to scale a horizontal Amazon RDS instance? EC2 and load balancing + autoscaling is extremely easy to implement, but if I want to scale Amazon RDS? I can trim my RDS instance with a more powerful instance, or I can create a read replica, and I can send 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 an autoscale RDS replica and balance them with load balancing?

+6
source share
3 answers

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

+6
source

If you use PostgreSQL and have a workload that can be shared by a specific key and does not require complex transactions, you can take a look at pg_shard . pg_shard allows you to create distributed tables that are distributed between multiple servers. Requests in a distributed table will be transparently routed to the right splinter.

Although RDS does not have the pg_shard extension installed, you can configure one or PostgreSQL servers on EC2 with the pg_shard extension and use the RDS nodes as work nodes. For pg_shard node, you only need to store a small bit of metadata that can be copied to one of the working nodes, so they are relatively low and can be scaled for higher requests.

A guide to the link with the CloudFormation template for automatic configuration is automatically available at: https://www.citusdata.com/blog/14-marco/178-scaling-out-postgresql-on-amazon-rds-using-masterless-pg- shard

+2
source

Note. RDS covers several databases: mysql, postgresql, Oracle, MSSQL.

Generally speaking, you can scale (a larger instance), use read-only databases or shards. If you are using mysql, take a look at AWS Aurora. Think about using the database optimally - perhaps in combination with memcached or Redis (both available under AWS Elasticache). Consider using a search engine (lucene, elasticsearch, cloudearch).

Some common resources:

+1
source

Source: https://habr.com/ru/post/982139/


All Articles