-1

I'm very new to this,so please correct if I'm wrong. I've understood that with Amazon RDS one can create read replicas and use those for all read-only operations. This helps scaling the application a lot.

Unfortunately, I have a PHP application that does not support separate read-write and read-only connections.

Is there a way around this, other than modifying the application?

closed as off-topic by gnat, Andres F., Laiv, Greg Burghardt, 8bittree Oct 31 '17 at 23:03

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions asking for assistance in explaining, writing or debugging code are off-topic here. These can be asked on Stack Overflow if they include the desired behavior, a specific problem or error, and the shortest code necessary to reproduce it in the question (see Minimal, Complete, and Verifiable Example)." – gnat, Andres F., Laiv, Greg Burghardt, 8bittree
If this question can be reworded to fit the rules in the help center, please edit the question.

3

When designing databases you have two basic choices: Scale-Up or Scale-Out. In the first case you use bigger machines (instances), for the second case you add more machines (instances) and this means read-replicas usually.

Unless you have a small application with no heavy database requirements, I would modify my code to support read-replicas. This is no easy task but well worth the investment (sometimes).

However, these architecture decisions are best made before implementing your systems, so it may be easier and cheaper to just Scale-Up in your case.

Sorry, there is no real answer for you situation. You will have to do the research to estimate the costs / value / time of each implementation.

  • Scale-out would be better, since we will have very short (few hours) peaks and could then scale down. – Tero Lahtinen Oct 10 '17 at 7:07
  • To Scale-Out you will need to support read-replicas or setup a clustered database server where every node is a read-write replica. I am not aware of any setups for database servers that auto scale up and down without building your own setup. – John Hanley Oct 10 '17 at 16:30
  • Or maybe just use ProxySQL to do read/write split. – Carson Ip Dec 15 '18 at 12:42
  • @CarsonIp - ProxySQL is a nice product, but you then introduce another node and a single point of failure. Read/Write splitting is not easy unless designed into the architecture. – John Hanley Dec 15 '18 at 15:12
  • @JohnHanley True. Though I usually install it in the application node so unless proxysql crashes, it should work when the application works. – Carson Ip Dec 18 '18 at 4:29

Not the answer you're looking for? Browse other questions tagged or ask your own question.