RDS databases have DNS names. The primary DB and read replicas have different DNS names.

  1. Does my code need to have access to the read replicas and if yes then in what way? 2)Once I have created my read replicas, is it automatic that my read throughput will be scaled out or does one make other configurations?
1 Answer

Although read replicas are not necessary required for your code to access them, it is strongly advised that you use them to divert read traffic away from the main database. You can enhance the functionality of your program and lighten the load on your main database by doing this. You can use the read replicas' DNS names to connect to them straight from your code in order to reach read replicas. For example, the MySQL command-line client or JDBC/ODBC drivers can be used to link to the read replicas.

Your read throughput will be scaled out automatically once your read replicas have been made. To guarantee that your application can benefit from the read, there are a few things you can do.

Update your application code to use the DNS names of the read replicas.

Distribute read traffic across the read replicas to avoid overloading any single read replica.

Use a load balancer to distribute read traffic across multiple read replicas.

Use read-only transactions to ensure that read traffic goes to the read replicas and not the primary database.

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions