Read replicas connections from Massive
Created by: jomendoz
Here at Airtm we're very happy to use Massive due to its simplicity and embrace of PostgreSQL full potential.
However we're growing faster and we need to handle more demand on our main DB server. So, for us, it's a time where we can spread horizontally than refactoring business logic.
Has anyone considered adding support for read replicas connections from Massive? I mean, there was a feature request on Sequelize like 6 years ago and it's working just fine. We're very hesitant to add such a heavy dependency on our services and we're willing to contribute code to Massive. This issue report is a heads up on any existing effort to sum up, or if there isn't any, to contribute such feature on Massive.
Reviewing Sequelize contribution on read replicas, their only criteria to choose a master or slave replica is if the involved DML query starts with
SELECT or not. Another proposal is to send a property in the
options object to force use of master replica in any operation, such as
count and others on Massive instance.
If you have any thoughts about this please let us know. We'll start to work on some PoC as soon as we find some spare time to try it out.