- Newest
- Most votes
- Most comments
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.
Relevant content
- asked 5 years ago
- asked 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 8 months ago