AskMe
AskMe

Reputation: 2561

Load balancing Or Read replica in AWS RDS

The ASP.net MVC application is in EC2 and interacting with RDS ( SQL Server). The application is sending Bulk GET request (API call) to RDS via NHibernate to get the items. The application performance is very slow as sometimes it’s making around 500 numbers of GET API call to get 500 items from the DB ( note - getting items from DB has its own stored procedure/ Logic)

I was referring this to understand scaling RDS https://aws.amazon.com/blogs/database/scaling-your-amazon-rds-instance-vertically-and-horizontally/ and https://aws.amazon.com/premiumsupport/knowledge-center/requests-rds-read-replicas/

However, didn’t get much clue that support my business scenario.

My questions are(considering above scenario):

  1. Is there any way to distribute my GET request to RDS (SQL Server) so that it can return the 500 items from SQL server quickly?

  2. Is it possible to achieve this without any code or existing architecture change ( both from .net an SQL end)?

  3. What are the different ways I should tryout to make this performance better?

  4. What are the pricing details for Read replica?

Note: The application does both read and write. And, I’m more concern about this particular GET API calls.

Thanks.

Upvotes: 1

Views: 1385

Answers (1)

Edcel Cabrera Vista
Edcel Cabrera Vista

Reputation: 1114

Is there any way to distribute my GET request to RDS (SQL Server) so that it can return the 500 items from SQL server quickly?

  • You will need to have a router in your application that will route the request to the read replicas(can be many).
  • You can provision a read replica with different instance type with enhanced capacity for that use-case.
  • You can try memory cache, it can reduce response time and can off load read work load to the read replicas.

Is it possible to achieve this without any code or existing architecture change ( both from .net an SQL end)?

  • Based on the documentation "applications can connect to a read replica just as they would to any DB instance." which means your application requires additional modification to support the use-case.

What are the different ways I should tryout to make this performance better?

  • memory cache and instance type with enhanced capacity for reads(the same suggestion above)

What are the pricing details for Read replica?

  • It will depends on the instance type that you provision.

enter image description here

Upvotes: 2

Related Questions